Re: Re: strtotime

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

 



On Sat, 2008-11-08 at 18:57 -0600, Micah Gersten wrote:
> Bastien Koert wrote:
> > 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
> >
> > in PHP5 strtotime gives a result of 19700101 when the data entered was
> > strtotime("20080950")
> >
> >   
> What does "work fine" mean?  "20080950" isn't normal, so what is the
> expected result?
> 
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
> 
> 
> 
Well, for starts Micah is right, your date string will be interpreted as
the 50th of September, 2008, which isn't valid and defaults to the time
represented by the timestamp 0. If you want to turn 8-digit number
strings into timestamps, make sure of two things:

1.It's actually a string and not a number
2.The string is in the format yyyymmdd

The strings can be a variety of formats, all found at
http://www.gnu.org/software/shishi/manual/html_node/Date-input-formats.html which is a link available on the strtotime manual page.


Ash
www.ashleysheridan.co.uk


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


[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