Skip to main content

How to modify wrong time zone in a Date object?


How can one modify the wrong time zone in a DateObject, without a conversion? Can one manipulate the TimeZone directly without having the numerical value of the time changing?



Answer



do1 = DateObject[3155673600]

enter image description here


do1 /. (TimeZone -> _) :> (TimeZone -> 12)


enter image description here


Observe that GMT-8 has become GMT+12. I believe this is what you want?


A different effect:


DateObject[do1, TimeZone -> 12]

enter image description here


00:00:00 has become 20:00:00 here.


Comments