From 67303b5f12085d454e755bfe2596f53e9ebaae4b Mon Sep 17 00:00:00 2001 From: pabs Date: Thu, 23 Aug 2007 02:17:04 -0400 Subject: subtract 1980 from datestamp years. --- zipstream.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'zipstream.php') diff --git a/zipstream.php b/zipstream.php index 48d3b9e..f23fb8b 100644 --- a/zipstream.php +++ b/zipstream.php @@ -204,10 +204,17 @@ class ZipStream { } function dostime($when = 0) { + # get date array for timestamp $d = getdate($when); + + # set lower-bound on dates if ($d['year'] < 1980) $d = array('year' => 1980, 'mon' => 1, 'mday' => 1, 'hours' => 0, 'minutes' => 0, 'seconds' => 0); + # remove extra years from 1980 + $d['year'] -= 1980; + + # return date string return ($d['year'] << 25) | ($d['mon'] << 21) | ($d['mday'] << 16) | ($d['hours'] << 11) | ($d['minutes'] << 5) | ($d['seconds'] >> 1); } -- cgit v1.2.3