For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2007 > how to increase given date by 30 sec









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author how to increase given date by 30 sec
Nancy Illegems

2007-04-06, 3:58 am



Sean

2007-04-06, 3:58 am


"Nancy Illegems" <nancy.illegems@telenet.be> wrote in message
news:002Rh.103784$3n5.690212@phobos.telenet-ops.be...
>
>


Someone may have a better way, but I am sure that this would do the trick.

$newtime = mktime(date("h"), date("i"), date("s") + 30, date("m") ,
date("d")+1, date("Y"));


Sean



Christoph Burschka

2007-04-06, 3:59 am

Sean schrieb:
> "Nancy Illegems" <nancy.illegems@telenet.be> wrote in message
> news:002Rh.103784$3n5.690212@phobos.telenet-ops.be...
>
>
> Someone may have a better way, but I am sure that this would do the trick.
>
> $newtime = mktime(date("h"), date("i"), date("s") + 30, date("m") ,
> date("d")+1, date("Y"));
>
>
> Sean
>
>
>


Wow... that's really taking the long way round, isn't it?

With the example you've named (the current time), how about this:

$newtime=time()+30

Of course, if you already have the date as a string, try something like
this:

$newtime=strtotime("2007-04-01 6:35:04")+30;
Sean

2007-04-10, 7:57 am


"Christoph Burschka" <christoph.burschka@rwth-aachen.de> wrote in message
news:57kgefF2d1itfU1@mid.dfncis.de...
> Sean schrieb:
>
> Wow... that's really taking the long way round, isn't it?
>
> With the example you've named (the current time), how about this:
>
> $newtime=time()+30
>
> Of course, if you already have the date as a string, try something like
> this:
>
> $newtime=strtotime("2007-04-01 6:35:04")+30;




I did say that there was probably a better way ... and you've shown that to
be true.



Jumanalebanese

2007-04-12, 10:19 am

http://Celine-Dion-facestanding-mov...hp?movie=148803
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com