convert d_time to Date without timezone conversion?

David Finlayson david.p.finlayson at gmail.com
Fri Apr 20 10:43:24 PDT 2007


I want to read Unix time stamps from a file and convert them to a human readable date. However, I want to leave them in UTC. Is there a D function that just returns the d_time string AS-IS without the UTC -> local timezone conversion?

for example:

d_time dtime = rndtol(unixtime * TicksPerSecond);  // convert Unix timestamp
char[] time = toTimeString(dtime); // WRONG! converts UTC to local time zone

I am not sure about the other string conversion functions like YearFromTime, etc. but I suspect they are doing time zone conversions also.




More information about the Digitalmars-d-learn mailing list