get current time and convert it to string

Carlos Santander csantander619 at gmail.com
Thu Apr 27 07:03:33 PDT 2006


Derek Parnell escribió:
> On Wed, 26 Apr 2006 21:58:48 +0200, Abby (J.P.) wrote:
> 
> 
>> By the way, is there a way to set the time shifting used for the function
>> std.date.UTCtoLocalTime(long t); ?
>> It does automatically put me at GMT+4, and that's not valid.
> 
> This is an undocumented 'feature' of std.date.
> 
> To set the local time zone you must set the public variable in std.date.
> 
> For example, to set the time zone to -4 hours from UTC...
> 
>    std.date.LocalTZA = -4 * msPerHour;
> 

I think this shouldn't be allowed: std.date.LocalTZA should be private.

> To get the local time zone as defined in your system's parameters ...
> 
>    d_time realLTZ = std.date.getLocalTZA();
> 


-- 
Carlos Santander Bernal



More information about the Digitalmars-d-learn mailing list