[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tlf-0.8.7 update before cqww-cw



On Sun, Nov 10, 2002 at 10:55:47AM -0800, Bob Nielsen wrote:
> That should work fine if the hardware clock is set to UTC.  It is
> possible, however, to set both the hardware clock and system clock to
> local time.  In that case, there is probably no easy way to handle the
> change in offset during these contests.  Running the hardware clock in

I might be missing something, but it doesn't seem hard at all. Does the
application need to be aware of the timezone offset at all? The OS
worries about this for you.

time() returns seconds since the epoch in reference to UTC. This should
continue to be correct after the daylight savings transition; the kernel
knows that the timezone has changed. Then use gmtime() to get
day/month/hour/minute components for UTC, or localtime() to get those
components in local time.

You can check that time() is unaffected by time zone:

perl 'print -e time;'
TZ=+800 perl 'print -e time;'

etc. You will not see sudden jumps in the result when changing TZ.

Hamish
-- 
Hamish Moffatt VK3SB <hamish@debian.org> <hamish@cloud.net.au>



Reply to: