diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-01-24 15:14:30 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-01-24 15:14:30 +0000 |
commit | 5aa42fc08283e46e20fe921726867c6b4a8b3151 (patch) | |
tree | 12cde792a458b81ca6df3ca7daf2324c54937f3a /lib/Time | |
parent | 04d420f9f994583149f1cf311471aaa7fbd5536d (diff) | |
download | perl-5aa42fc08283e46e20fe921726867c6b4a8b3151.tar.gz |
Mention year-1900 and month 0..11.
p4raw-id: //depot/cfgperl@2705
Diffstat (limited to 'lib/Time')
-rw-r--r-- | lib/Time/Local.pm | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm index eef412d46d..b2fba7ccc1 100644 --- a/lib/Time/Local.pm +++ b/lib/Time/Local.pm @@ -17,16 +17,18 @@ Time::Local - efficiently compute time from local and GMT time =head1 DESCRIPTION -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. +These routines are quite efficient and yet are always guaranteed to +agree with localtime() and gmtime(), the most notable points being +that year is year-1900 and month is 0..11. 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 |