Re: Bug in mktime-function ?

From: Date: Wed, 14 Feb 2001 17:29:30 +0000
Subject: Re: Bug in mktime-function ?
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-5566@lists.php.net to get a copy of this message
Dirk: Date/time values in PHP are handled as UNIX timestamps, that is, the number of seconds since what they call the UNIX Epoch (whatever it means), in other words, 1970. Before that, nothing existed, so no need for time. Saludos, Pablo _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Wednesday, February 14, 2001, 10:29:36 AM, Dirk wrote: DDdc> Hello PHP-users, DDdc> given the following code snippet to convert ISO-date-strings to localized DDdc> date-strings: DDdc> <?php DDdc> $stringArray = explode("-", "1985-01-01"); DDdc> $month = $stringArray[1]; DDdc> $day = $stringArray[2]; DDdc> $year = $stringArray[0]; DDdc> $date = mktime(0,0,0,$month,$day,$year); DDdc> $value = strftime("%d.%m.%Y", $date); DDdc> echo $value; ?>> DDdc> This code works fine as long as I use dates after 1970, all earlier DDdc> dates result in an empty value. DDdc> According to the docs, mktime is supposed to work fine with 4-digit DDdc> dates. DDdc> What is the problem here... DDdc> Greetings, DDdc> Dirk

« previous php.windows (#5566) next »