5
$\begingroup$

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?

$\endgroup$
3
$\begingroup$
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.

$\endgroup$
  • $\begingroup$ This is exactly what I was looking for! Your first suggestion does the job - excellent! $\endgroup$ – hippo3773 Feb 4 '16 at 16:50
  • $\begingroup$ @hippo3773 I am glad I could help. Since you say this is exactly what you were looking for please consider Accepting this answer. $\endgroup$ – Mr.Wizard Feb 4 '16 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.