I dont' care if it is MST or MDT, but I have a LocalDateTime object with the time(ie. no timezone). I want to add MST or MDT and create a DateTime object such that I can get milliseconds since the epoch for storage and milliseconds from the epoch is in UTC of course just like System.currentTimeMillis is in UTC.
So is there a way to say MountainTime independent of savings or daylight time as it should know that from the date it has itself, correct? How to do that?
thanks, Dean
A LocalDateTime is just a bunch of numbers (day, month, year, hour, minute...) that represent a civil (not a physic) concept. A Datetime is instead a physical concept (an instant of time), which in addition has a Timezone, and hence, it can be expressed in day/month/year.
To convert from a LocalDateTime to a Datetime, you need to specify a Timezone. This conversion is not totally well defined, though; because at DST transitions two different DateTimes can correspond to a same LocalDateTime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With