Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-30-2009, 03:57 PM   PM User | #1
mobimad
New Coder

 
Join Date: Oct 2009
Location: UK
Posts: 84
Thanks: 12
Thanked 0 Times in 0 Posts
mobimad is an unknown quantity at this point
How do i add 5 hours to PHP Time Code

Hi Guys / Girls

I have a php date and time that im using which is

"F d Y, H:i"

but this is using the time from the server in US and i'm in UK, so how can i add 5 hours to the time to be correct for me.

Thanks in-advance for your help

P.S i'm a php newbie i'm afraid !!!

Jenna
mobimad is offline   Reply With Quote
Old 10-30-2009, 04:18 PM   PM User | #2
er4o
New Coder

 
Join Date: Apr 2008
Location: Blagoevgrad, Bulgaria
Posts: 47
Thanks: 0
Thanked 8 Times in 8 Posts
er4o is an unknown quantity at this point
Something like this, maybe?

echo date("F d Y, H:i", strtotime("+5 hour"));

or

echo date("F d Y, H:i", (time() + (5 * 60 * 60)));

Last edited by er4o; 10-30-2009 at 04:32 PM..
er4o is offline   Reply With Quote
Old 10-30-2009, 04:21 PM   PM User | #3
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
date_default_timezone_set()
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 10-30-2009, 07:50 PM   PM User | #4
Phil Jackson
Senior Coder

 
Join Date: Aug 2009
Location: Mansfield, Nottinghamshire, UK
Posts: 1,547
Thanks: 57
Thanked 148 Times in 147 Posts
Phil Jackson is on a distinguished road
strtotime() for php4
__________________
Website Design Mansfield
PHP Code:
function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
echo 
I_LOVE(); 
Phil Jackson is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:02 PM.


Advertisement
Log in to turn off these ads.