I'm designing a function that given a UTC timestamp will convert it to the local time.The question I have, should the current times DST settings be applied to the conversion, or the timestamps DST settings?If going with the former, current DST setting applied to timestamp - it would mean 4pm that was recorded with DST+1 would be 3pm with DST+0 and 4pm with DST+0, depending on the time of the year you checked the date at.If going with the latter, the timestamps DST setting would be applied to it - so 4pm recorded with DST+1 will always say 4pm, no matter what time of the year you've checked it at.Which is more preferrable in practice?
Date & time - apply current, or 'then' DST?
time;date format
Use the DST settings applicable to the timestamp.  This will apply the correct conversion rules.  For example if I use the current DST status a local time in January would be incorrectly converted, as I am currently in DST and January uses ST here.Most languages already have a function or method to do the conversion.  Unless you have strong reasons to write your own, use it.  This code should provide a way to determine if the the timestamp is DST or ST.Many protocols use a format which includes the offset from UTC, as a suffix.  For example:Delivery-date: Sat, 14 Sep 2013 06:47:18 -0400There are a lot of pitfalls in writing your own code:Rules change from time to time.Timezone change is often not done at midnight.Rules can be different for different locations in the same timezone.Leap seconds may or may not be included in the time stamps.The Olson Time Zone Database contains an accurate rule set and is frequently updated.