You are here: Re: Time + 10 minutes « PHP Programming Language « IT news, forums, messages
Re: Time + 10 minutes

Posted by Rik on 01/04/07 22:59

David Gillen wrote:
> Moot said:
>> Krustov wrote:
>>>> $ganja=date("D dS M h:i A",time()+600);
>>>>
>>>
>>> That worked fine - thanks to both users .
>>>
>>
>> Or, if you're like me and don't want to figure out the correct number
>> to add for various intervals, a more plain-english style solution
>> would be:
>> $ganja = date("D dS M h:i A",strtotime("+10 minutes"));
>>
> Haha, I like that. Anything that makes something easier to understand
> when scanning the code is good.

Well strtotime has it's advantages. However, it's poorly documented and
sometimes unpredictable. After a short while I reverted back to working
with adding/subtracting timestamps, just with a comment in the code beside
it. Equally (or even more) clear thans to the comment, and 100%
predictable.
--
Rik Wasmus

 

Navigation:

[Reply to this 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

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