timezone problem

Stewart Gordon smjg_1998 at yahoo.com
Tue Jan 13 10:34:55 PST 2009


Sergey Gromov wrote:
<snip>
> I thought that std.date.getUTCtime(), std.date.UTCtoLocalTime() and
> std.date.LocalTimetoUTC() were quite enough.

std.date is somewhat badly designed - a time can be in any time zone but 
has no time zone information in it.  And toString(d_time) expects a UTC 
time but formats in the user's time zone.

My library stores all times in UTC, but allows them to be manipulated in 
any time zone.  But it doesn't yet support daylight saving time 
adjustments.  I haven't quite worked out how best to do this.  (It 
initialises the working time zone to the user's current time zone under 
Windows, but that's it at the moment.)

http://pr.stewartsplace.org.uk/d/sutil/

Stewart.


More information about the Digitalmars-d-learn mailing list