[Typo3-dev] OT: maketime

Simon Child simondt at gpuk.net
Thu Sep 23 18:13:27 CEST 2004


"Peter Niederlag" <niederlag at ikd01.de> wrote in message
news:mailman.112.1095952072.19465.typo3-dev at lists.netfielders.de...

> <?php
> $timestamp = mktime(1, 0, 0, 1, 1, 1970, 0);
> echo $timestamp . "\n";
> ?>
>
> Does return '0'?
>
> I just don't get it. :-<

http://uk.php.net/manual/en/function.mktime.php

The next to bottom note on that page:

==============
I think it is important to note that the timestamp returned is based upon
the number of seconds from the epoch GMT, and then modified by the time zone
settings on the server.

Thus...

mktime(0,0,0,1,1,1970) will not always return 0.  For example with the US
eastern time zone (GMT-5) will return 18000 (5 hours past the epoch) and the
same function with the time zone set to the US pacific time zone (GMT-8)
will return 28800 (8 hours past the epoch).

In an instance where you want time zone independence, you should use the
function gmmktime()
==============

-- 
Simon Child







More information about the TYPO3-dev mailing list