Time different between my apache server and my local clock

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steven

    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


  • NotIan

    #2
    Re: Time different between my apache server and my local clock

    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" <xueming@comcas t.net> wrote in message
    news:AKLOa.1391 9$H17.5375@sccr nsc02...[color=blue]
    > I actually have two questions:
    >
    > 1. I try to get current time, but the time I got is 1 hour different from[/color]
    my[color=blue]
    > local time. I assume it is caused by Time Zone. So is there any easy way[/color]
    to[color=blue]
    > fix this? I assume that I can first get the Time Zone of the server by[/color]
    using[color=blue]
    > 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[/color]
    the[color=blue]
    > apache server clock (I don't own the server)?
    >
    > Thanks in advance.
    >
    > -Steven
    >
    >[/color]


    Comment

    Working...