Re: Re: strtotime

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



O/H gilles έγραψε:
"Thodoris" <tgol@xxxxxxxxxx> a ιcrit dans le message de news: 4916BB77.9030609@xxxxxxxxxxxxx
O/H Bastien Koert ??????:
2008/11/8 Maciek Sokolewicz <tularis@xxxxxxxxx>


gilles wrote:


Avec la version 4 de php, strtotime("20080950") fonctionne correctement en
allant sur le mois d'octobre, alors qu'en version 5: 19700101.
Merci de votre aide



This is an ENGLISH list, please rephrase your question in english and
people might understand.

Cette liste est une liste anglaise, reformulent svp votre question en
anglais svp.

merci,

- Tul


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



I'll translate

In PHP4, strtotime works fine

Define "works  fine".

in PHP5 strtotime gives a result of 19700101 when the data entered was
strtotime("20080950")


Linux
PHP version 5.1.6
Apache 2

This strtotime("20080950") returns nothing.

---
Thodoris
"Works fine" in php4 means date("d/m/Y",strtotime("20080950")) returns 20/10/2008, which is correct. Thanks



In another server this:

<?php
$tstamp = date("d/m/Y",strtotime("20080950"));

print "<pre>";
print $tstamp;
?>

gives me:
01/01/1970

Funny isn't it? I gives me the epoch start date. Probably because strtotime returns null so date thinks that null is equivalent to 0 or something like that AFAIK.

Nevertheless this 20080950 is not a valid date so this behavior makes more sense to me than getting 20/10/2008 as a result. So any invalid date will probably give you 01/01/1970.




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux