Re: Date and time problem
| From: | Tom Rogers | Date: | Mon, 03 Feb 2003 01:42:46 +0000 |
| Subject: | Re: Date and time problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134070@lists.php.net to get a copy of this message | ||
Hi,
Monday, February 3, 2003, 11:10:36 AM, you wrote:
DLM> Hello friends.
DLM> The follwing code displays the date on my webpage :
DLM> echo date ("l dS of F Y h:i:s A");
DLM> However, I need to add 12 hrs to this date befor displaying on the webpage. Can someone
DLM> please help me to modify the above code?
DLM> Thanks
DLM> Denis
use strtotime to get the timestamp for date like this
echo date ("l dS of F Y h:i:s A", strtotime('+12 hours'));
If this is to compensate for a timezone difference you could also set the
timezone at the top of the page, for example
putenv('TZ=Australia/Brisbane');
Then date by itself will give the desired result
--
regards,
Tom