php-general | 2004032
Date: 03/31/04
- Next message: Firman Wandayandi: "[PHP] WARNING! Virus"
- Previous message: Lester Caine: "Re: [PHP] Re: STOP to send me mails !!!! Re: [PHP] Re: list to array help :-)"
- In reply to: Hawkes, Richard: "RE: [PHP] adding days to a given date"
- Next in thread: Hawkes, Richard: "RE: [PHP] adding days to a given date"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
thanx Richard, that works excellent.
Merlin
Richard Hawkes wrote:
> You'll want to do something like this:
>
> $timeStamp = strtotime("2004-04-29");
> $timeStamp += 24 * 60 * 60 * 7; // (add 7 days)
> $newDate = date("Y-m-d", $timeStamp);
>
> The 'strtotime' function converts all sorts of standard dates to the Unix
> Epoch seconds (seconds since 1/1/1970). You then just add the required
> seconds!
>
> Cheers
> Richard
>
>
>
> -----Original Message-----
> From: Merlin [mailto:news.groups <email protected>]
> Sent: 31 March 2004 10:01
> To: php-general <email protected>
> Subject: [PHP] adding days to a given date
>
>
> Hi there,
>
> I am trying to add days to a given day, but somehow I am lost in all the time
> functions.
> This should be a standard function. Maybe someone has a good hint for me?
>
> This is the given day:
> 2004-04-29
> I would like to add 2 days to it.
> So php should anyhow now how many days April has to result in this:
> 2004-04-30
> 2004-05-1
>
> Thank you for any helpful hint,
>
> merlin
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Firman Wandayandi: "[PHP] WARNING! Virus"
- Previous message: Lester Caine: "Re: [PHP] Re: STOP to send me mails !!!! Re: [PHP] Re: list to array help :-)"
- In reply to: Hawkes, Richard: "RE: [PHP] adding days to a given date"
- Next in thread: Hawkes, Richard: "RE: [PHP] adding days to a given date"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

