std.date again

Carlos Santander csantander619 at gmail.com
Tue May 9 07:48:37 PDT 2006


Kyle Furlong escribió:
> Carlos Santander wrote:
>> Here it's again:
>>
>> //------------------------
>> import std.date;
>> import std.stdio;
>>
>> void main()
>> {
>> writefln("UTC  :%s", toTimeString(getUTCtime()));
>> writefln("Local:%s", toTimeString(UTCtoLocalTime(getUTCtime())));
>> }
>> //------------------------
>>
>> :::: gdc 0.17, Mac OS X 10.4.6
>>
>> $ ./test
>> UTC  :06:20:52 GMT+0500
>> Local:11:20:52 GMT+0500
>>
>> $ date
>> Mon May  8 20:21:01 ECT 2006
>>
>>
>> :::: DMD 0.155, Windows XP SP 2
>>
>> D:\>test
>> UTC  :01:27:19 GMT+0000
>> Local:01:27:19 GMT+0000
>>
>> D:\>time
>> La hora actual es: 20:27:32,08
>>
>>
>> :::: DMD 0.155, Mandrake Linux 10.1
>>
>> $ ./test
>> UTC  :20:34:23 GMT-0500
>> Local:15:34:23 GMT-0500
>>
>> $ date
>> lun may  8 20:34:27 ECT 2006
>>
>>
>> Walter, at least take a look at UTC on Linux: that's the correct local 
>> time, which most certainly gives a clue of where the solution might be.
>>
>> In all my systems, the timezone is GMT -0500 aka Bogotá, Lima, Quito, 
>> aka ECT.
>>
>>
> 
> You might want to use mango.locale. 
> http://dsource.org/projects/mango/browser/trunk/mango/locale?rev=883
> 

I know there're other options, but that's no reason for Phobos to be wrong.

-- 
Carlos Santander Bernal



More information about the Digitalmars-d-bugs mailing list