server time

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

Post Reply
daijames
Forum Newbie
Posts: 10
Joined: Mon Sep 12, 2011 3:50 pm

server time

Post by daijames »

Hi
I am trying to allow an offset for my server time which is EDT and runs 5 hours behind mine (GMT/UTC)
I find I can alter the time by adding

Code: Select all

date_default_timezone_set('Europe/London');
in each script
or adding :
php_Value date.timezone US/New York or SetEnv TZ Europe/London to my .htaccess file
HOWEVER the time I am getting is 12 hours behind I cannot understand this ???
so for example my time is say 15.00h my server time shows 10.00 and when I try and change it the result is 03.00h
Dodon
Forum Commoner
Posts: 64
Joined: Wed Aug 03, 2011 4:11 am
Location: Netherlands

Re: server time

Post by Dodon »

What script you use to get the time? since 03.00 pm is the same as 15.00.

try:

Code: Select all

date("H:i:s");
 
note the capital H, which indicates a 24h time format
Post Reply