Forums Register Login

Timezone conversion

+Pie Number of slices to send: Send
I have this program



Here i am getting a time with a timezone and the timezone is in UTC, is that a correct assumption
the output is as follows, why is not as per the input
2013-10-15T12:43 -0600
1381862580000
2013-10-15T12:43 -0600


+Pie Number of slices to send: Send
 

Jacob Sonia wrote:Here i am getting a time with a timezone and the timezone is in UTC, is that a correct assumption


I'm not sure what you mean, but I would say no, nothing there is in UTC. Except the strings -0600 and -0700 both reference timezones relative to UTC, if that's what you mean.
the output is as follows, why is not as per the input

Jacob Sonia wrote:2013-10-15T12:43 -0600
1381862580000
2013-10-15T12:43 -0600


You mean, why does it not use UTC-0700? Because you've requested that outFormat format the output using America/Denver, which currently gives Mountain Daylight Time, which is UTC-0600. If you want it to use a different time zone, identify the time zone you want to use, and tell the formatter to use that time zone.

Note that there is no difference in value between the date you call "date" and the one you call "mstTime". They represent exactly the same thing. Neither one has a time zone associated with it - Date objects never do. (Except when toString() is called on them, and the system default time zone is used.)

Try this:
keep an eye out for scorpions and black widows. But the tiny ads are safe.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 728 times.
Similar Threads
Time Zone problem
time to be converted to MST time
Time difference
Timestamp advanced 4 hours
Timestamp Time Difference
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:30:45.