> This is related to network connections -off line it won't work.

The code will pick up the current differential between utc and local time.  An 
improvement could be to have the OS signal DST changes (not sure if it can), or 
an internet service connect via socket when dst  changes.  Or as part of the 
startup code, the program could look up the next time a dst change event 
occurs, and set up a timer for that many days in the future.  Is 2am local time 
a universal standard for when clocks change?



----- Original Message -----
From: Don Kelly <[email protected]>
To: [email protected]
Cc: 
Sent: Thursday, March 27, 2014 12:12:00 AM
Subject: Re: [Jprogramming] datetime utc mod

If this is of real interest - Windows 7 adjusts the clock for local DST 
in whatever region is involved- I know the time in New Zealand 
(important me as I have grandkids there) . This is related to network 
connections -off line it won't work.. In any case there is a 3 ,4, or 5 
hour + a day, from Pacific time to Wellington time (depending on DST)
How you transfer this to J is another problem- but it seems as if is not 
quite as complex as shown - and this raises another problem- why? Is it 
critical?

Don Kelly


On 25/03/2014 5:48 PM, bill lam wrote:
> there should be some api in libc or windows dll to get utc time directly IIRC.
>
> 26.03.2014, в 2:30, Pascal Jasmin <[email protected]> написал(а):
>
>> Here are additions I've made to datetime.ijs (addons/type)
>>
>> utcnow_z_ '' returns utc time tested on mac and windows.
>>
>> a question about 6!:0 ... when DST changes, will it report the changes 
>> without reloading J? Some OS change the time automatically, while others ask 
>> to change clock, or do they all ask?
>>
>> Now_z_ =: 6!:0@:(''"_)
>> utcBIAS_z_ =: 3 : 0 '' NB. may bug on unix if loaded at turn of month/year,  
>> so redo.  Must reload on DST change
>> if. IFWIN do. 0,~ >1{ getTimeZoneInfo_rgsdatetime_ ''
>> elseif. IFIOS do. 0
>> elseif. 1 do.  t=. +/ 3600 60 1 * (2 3 4{6!:0'') -~ (0&".@:>@:(1&{),~ 
>> ".@:>@:{:@:;:@:>@:{.) ':' cut 2!:0 'date -u'
>> if. 0=15|t do. t, 0 else.  0 ,~ +/ 3600 60 1 * (2 3 4{6!:0'') -~ 
>> (0&".@:>@:(1&{),~ ".@:>@:{:@:;:@:>@:{.) ':' cut 2!:0 'date -u'  end. end.
>> )
>> utc_z_ =: tsPlus&utcBIAS
>> utcnow_z_ =: utc@:Now ''"_
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm

> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to