471,853 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,853 software developers and data experts.

Time different between my apache server and my local clock

I actually have two questions:

1. I try to get current time, but the time I got is 1 hour different from my
local time. I assume it is caused by Time Zone. So is there any easy way to
fix this? I assume that I can first get the Time Zone of the server by using
the T option in date, and then using my local Time Zone to calculate the
difference. But I am wondering if there is some buil-in function to do it.

2. I found out this also today while workng on the same project. My apache
clock is 10 mins slower than my local clock. Any suggection to calibrate the
apache server clock (I don't own the server)?

Thanks in advance.

-Steven
Jul 16 '05 #1
1 4957
Make a function like
(substitute mdifference, hdifference for the difference in the clocks and
adjust +/- accordingly, though this is untested it shoudl work)
function localdate()
{
$hourdifference = "1";
$mdifference = "10";
$hour = date('h') + $hdifference;
$minute = date('i') + mdifference;
if($i < 10)
{
$minute = "0".$minute;
}
$both = $hour.$minute;
return $both;
}

"Steven" <xu*****@comcast.net> wrote in message
news:AKLOa.13919$H17.5375@sccrnsc02...
I actually have two questions:

1. I try to get current time, but the time I got is 1 hour different from my local time. I assume it is caused by Time Zone. So is there any easy way to fix this? I assume that I can first get the Time Zone of the server by using the T option in date, and then using my local Time Zone to calculate the
difference. But I am wondering if there is some buil-in function to do it.

2. I found out this also today while workng on the same project. My apache
clock is 10 mins slower than my local clock. Any suggection to calibrate the apache server clock (I don't own the server)?

Thanks in advance.

-Steven

Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by dan glenn | last post: by
2 posts views Thread by arcvonz | last post: by
7 posts views Thread by WindAndWaves | last post: by
12 posts views Thread by aegis | last post: by
74 posts views Thread by Dominik Wallner | last post: by
37 posts views Thread by David T. Ashley | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
aboka
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.