PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
ericburnard
Forum Contributor
Posts: 104 Joined: Wed Jun 15, 2005 5:11 pm
Location: Chesterfield, UK
Post
by ericburnard » Tue Dec 06, 2005 12:20 pm
i am using this code
for my date and time and instead of getting the correct time i am getting one 8 hours earlier.
What can i do to make it show thie time on my computer.
(my site is
http://www.madashatters.com is you want to look at the date on the blog entry. it was actually posted at 6.12 pm)
thanks
Eric
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Tue Dec 06, 2005 12:20 pm
Sounds like the date on your server is different than your local time.
ericburnard
Forum Contributor
Posts: 104 Joined: Wed Jun 15, 2005 5:11 pm
Location: Chesterfield, UK
Post
by ericburnard » Tue Dec 06, 2005 12:24 pm
how can i change thAT to my time? can i?
eric
[EDIT] its not my server im hosted on ipowerweb
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Tue Dec 06, 2005 12:26 pm
Code: Select all
date('d/m/Y :: [G]',strtotime("+ 8 hours"));
ericburnard
Forum Contributor
Posts: 104 Joined: Wed Jun 15, 2005 5:11 pm
Location: Chesterfield, UK
Post
by ericburnard » Tue Dec 06, 2005 12:30 pm
ahhhh thank you very much
hawleyjr
BeerMod
Posts: 2170 Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA
Post
by hawleyjr » Tue Dec 06, 2005 12:41 pm
I would create a function or even better a constant value for the date difference.
This way you only have one place to change the date offset incase you change servers...
Burrito
Spockulator
Posts: 4715 Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah
Post
by Burrito » Tue Dec 06, 2005 12:48 pm
what you should do is create a "preferences" section so users can set their own time (zone) and have it calculate their local time automatically.
ericburnard
Forum Contributor
Posts: 104 Joined: Wed Jun 15, 2005 5:11 pm
Location: Chesterfield, UK
Post
by ericburnard » Tue Dec 06, 2005 5:06 pm
well at the moment im just trying to get my site up an running but when thats done i wthink ill do the preferences thing to put in with my admin section etc.
Thanks again
Eric