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

Re: [MacPerl] reverse localtime



On Thu, 25 May 2000 16:27:24 -0400, Eric Rainey wrote:

>Well, it seems that timelocal() requires all of the arguments, when 
>all I have is day of the year.

It looks like Keary Suska already provided the answer I wanted to give.
Get the seconds for Jan 1 at 00:00:00, and add 24*60*60 times the
daynumber minus 1.

>And timelocal doesn't even seem to 
>support day of year or daylight savings (according to the pod).

GMT is independent of daylight savings time. It just goes on and on...
forever.

I thought timelocal() was exactly the opposite of localtime(). So if
localtime() properly supports daylight saving time, so should
timelocal(). Er... not on a Mac, I guess?

Besides, the rules for DST may change over time. Even if your system
automatically adjusts for Daylight Saving Time (it does on FreeBSD, and
probably on other Unix(-like) systems), you may need a system update if
the rules change.

-- 
	Bart.

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org