*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> perl5/Time::Local (3)              
Title
Content
Arch
Section
 

Contents


Time::Local(3)							Time::Local(3)


NAME    [Toc]    [Back]

     Time::Local - efficiently compute time from local and GMT time

SYNOPSIS    [Toc]    [Back]

	 $time = timelocal($sec,$min,$hours,$mday,$mon,$year);
	 $time = timegm($sec,$min,$hours,$mday,$mon,$year);

DESCRIPTION    [Toc]    [Back]

     These routines are	quite efficient	and yet	are always guaranteed to agree
     with localtime() and gmtime().  We	manage this by caching the start times
     of	any months we've seen before.  If we know the start time of the	month,
     we	can always calculate any time within the month.	 The start times
     themselves	are guessed by successive approximation	starting at the
     current time, since most dates seen in practice are close to the current
     date.  Unlike algorithms that do a	binary search (calling gmtime once for
     each bit of the time value, resulting in 32 calls), this algorithm	calls
     it	at most	6 times, and usually only once or twice.  If you hit the month
     cache, of course, it doesn't call it at all.

     timelocal is implemented using the	same cache.  We	just assume that we're
     translating a GMT time, and then fudge it when we're done for the
     timezone and daylight savings arguments.  The timezone is determined by
     examining the result of localtime(0) when the package is initialized.
     The daylight savings offset is currently assumed to be one	hour.

     Both routines return -1 if	the integer limit is hit. I.e. for dates after
     the 1st of	January, 2038 on most machines.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
adjkerntz FreeBSD adjust local time CMOS clock to reflect time zone changes and keep current timezone offset for the k...
dst HP-UX difference between Universal (Greenwich mean) time and Local time
timezone HP-UX difference between Universal (Greenwich mean) time and Local time
pxflocaltime IRIX Converts to local time
change HP-UX Alters the epoch number and time on the local node
dts_update HP-UX Gradually adjusts the clock on the local node to the specified time
create_link HP-UX Creates a soft link and optionally specifies an expiration time and an extension time
vxfs_ifree_timelag HP-UX VxFS inode free time lag (specifies the minimum time to be spent on a freelist)
settimeofday64 Tru64 Gets and sets date and time and converts time between timeval and timeval64
settimeofday Tru64 Gets and sets date and time and converts time between timeval and timeval64
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service