Reply to Re: Time + 10 minutes

Your name:

Reply:


Posted by Michael Fesser on 01/06/07 01:27

..oO(Moot)

>Agreed. strtotime has some annoying flaws that aren't officially
>documented. For an illustration, try the following code:
>[...]
>
>This example shows how strtotime's handling of months could really
>screw up logic expecting it to work in a different way than it actually
>does (I should know, I've learned it the hard way). Since there are 28
>days in Feb, strtotime adds the 3 extra days (to 31) and ends up at
>March 3rd, similar problem with April, which has 30 days, so the extra
>1 puts it to May 1st.

This behaviour is documented:

| The fuzz in units can cause problems with relative items. For example,
| `2003-07-31 -1 month' might evaluate to 2003-07-01, because 2003-06-31
| is an invalid date. To determine the previous month more reliably, you
| can ask for the month before the 15th of the current month. [...]

http://www.gnu.org/software/tar/manual/html_node/tar_115.html#SEC115

Micha

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация