|
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]
|