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

Posted by Geoff Berrow on 01/05/07 00:44

Message-ID: <cdb55$459d862e$8259c69c$18037@news2.tudelft.nl> from Rik
contained the following:

>>> $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.

I've had the same experience. And if you really can't work out the
number of seconds in ten minutes, let the code do the work

$ganja=date("D dS M h:i A",time()+(60*10));

Personally though I'd rather keep things that I may want to change
elsewhere, so:

$delay=600;
//this can be in a config file and commented
....
$ganja=date("D dS M h:i A",time()+$delay);



--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

 

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

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