Subject: Re: TZ and unix epoc
To: None <tech-kern@NetBSD.org>
From: George Georgalis <george@galis.org>
List: tech-kern
Date: 02/26/2006 21:51:33
On Sun, Feb 26, 2006 at 12:03:10AM -0600, Eric Haszlakiewicz wrote:
>On Sun, Feb 26, 2006 at 06:10:16PM -0500, George Georgalis wrote:
>> 
>> It's not clear how I may determine unix seconds for the zero
>> second of the present day, in a given timezone, with netbsd.
>
>Well, don't bother with that.  Just do this:
>	TZ='GMT-1' date +"%H 60 * %M + 60 * %S + 10 * 864 / p" | dc

well enough. I'm not sure how that works though, never seen dc,
it does seem correct here in -0500 land.

Before I saw that I applied Simon's technique to bc...

echo "@$(env TZ='GMT-1' date '+(((%k * 60 * 60) + (%M * 60) + %S) * 10)/864' | bc)" 

seconds of hours in the day + seconds of min + seconds, all times 10, mod 864.

Thanks,
// George

PS both statements above also works in Linux, if you have dc installed..

-- 
George Georgalis, systems architect, administrator <IXOYE><
http://galis.org/ cell:646-331-2027 mailto:george@galis.org