aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpabs <pabs@pablotron.org>2007-08-23 02:17:04 -0400
committerpabs <pabs@pablotron.org>2007-08-23 02:17:04 -0400
commit67303b5f12085d454e755bfe2596f53e9ebaae4b (patch)
treeee7e73173bec227665ed3278f5240c2c3da20054
parent0f7fe529547ef6bca5c14a2b1de6f4b0fd8ae1fa (diff)
downloadzipstream-php-67303b5f12085d454e755bfe2596f53e9ebaae4b.tar.bz2
zipstream-php-67303b5f12085d454e755bfe2596f53e9ebaae4b.zip
subtract 1980 from datestamp years.
-rw-r--r--zipstream.php7
1 files changed, 7 insertions, 0 deletions
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);
}