On Fri, 27 Jun 2014 15:28:41 -0700, Hardee, Chuck wrote: >I am in the process of writing a program that is reading several files. >Some of the files have dates in local and some have dates in UTC. >I want to be able to move between the two time bases as needed. >I don't envision the program reading files from differing time zones at the >same time, but the program could be reading files from any country in the >world. >Currently I'm concentrating on the US so a US based solution would be fine for >the moment. > >Where I can't seem to get my head to go is related to Daylight Savings Time >(DST). >If, for instance, the locale is the east coast of the US, the UTC adjustment >would be -05:00, 05:00 UTC is 00:00 local. If the local time is 02:00 on the >day of the switch in the spring, that's easy, subtract the signed UTC >adjustment from the local time and then add 1 hour. So, 02:00 - (-05:00) - >01:00 = 06:00 UTC.
There is no 02:00 local time on the day of the switch. After 1:59 comes 03:00. >But, what if the local time is 01:59? One would subtract the signed UTC >adjustment from the local time and then??? So, 01:59 - (-05:00) = 06:59, but >what about Daylight Savings Time? The current local time being adjusted is not >with the DST range, but the adjusted time via the UTC adjustment value is. >Does DST come into play here? Is the decision based on the local time or the >resulting UTC time? > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
