The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Server time not using right timezone

Discussion in 'General Discussion' started by Zoop, Aug 5, 2016.

Tags:
  1. Zoop

    Zoop Member

    Joined:
    Feb 15, 2016
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Hello folks,

    Ive got an issue and it's driving me crazy. We've got several CPanel servers and they are pretty much configured the same way.

    One of the servers seems to have an incorrect time/timezone configuration, as date functions in php are always off by 2 or 3 hours.

    When I look at the Server Time option in WHM is see this:

    Fri Aug 5 16:03:08 GMT-2 2016
    Configure Timezone
    Europe/Amsterdam Change Timezone

    So it is set to Europe/Amsterdam timezone, which should be CEST or GMT+1. When I look at the same thing on another server, it nicely says its using CEST timezone (and thus has correct times).

    Resyncing it, or changing the timezone has no effect.

    Why is my server using GMT-2 on this timezone? Thats completely incorrect, and im at a loss where to look. Any suggestions? Thanks
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,446
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  3. Zoop

    Zoop Member

    Joined:
    Feb 15, 2016
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    No its not, not at all. Im saying the steps described in that document wont work. Changing the timezone does not correct it, nordoes doing it by commandline.

    Even though the timezone is set to Europe/Amsterdam, it shows GMT-2 on the same screen, thats simply not correct.
    Changing it to another timezone and back does not help either. Syncing with server als doesnt help. Schermafbeelding 2016-08-12 om 15.16.34.png
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    Please post the output from the following command in order to verify the server environment this is happening on:

    Code:
    grep '' /etc/redhat-release /usr/local/cpanel/version /var/cpanel/envtype
    I've seen this behavior on VPS environments in the past, as it's a limitation of the VPS software used on the main server node.

    Thank you.
     
  5. Zoop

    Zoop Member

    Joined:
    Feb 15, 2016
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Hi Michael, here is the output:

    Code:
    /etc/redhat-release:CentOS Linux release 7.2.1511 (Core)
    /usr/local/cpanel/version:11.58.0.20
    /var/cpanel/envtype:kvm
    Thanks
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Please contact your provider and verify if the following considerations for adjusting a time zone or server time for KVM guests is applicable to their environment:

    Chapter 9. KVM guest timing management

    Thank you.
     
  7. Zoop

    Zoop Member

    Joined:
    Feb 15, 2016
    Messages:
    13
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    My VPS provider forwarded me to set up ntpd, which i did. After completing the steps and running the 'date' command from terminal, i get a proper response:
    Meaning, its something i had to do myself, it wasnt something for my VPS provider to do, so why did you ask me to contact my provider?

    Testing it in PHP by var_dumping a datetime object without setting any timezones also gives the proper time. However, the situtation in screenshot i attached earlier is still present. It still shows GMT-2 there, while it should be either CEST (like my other Cpanel server shows) or GMT+2 / UTC-1

    While i certainly got progress because it shows correctly in the scripts now, but its strange the config still shows it wrong.
    This is a complete CentOS+Cpanel installation (supposed to work out of the box, right?), the same as 3 other servers we own, but this is the only one that has these problems.

    Why is this happening? And why do i need to set up NTPD while i never did such thing on the other servers?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I'm happy to see you were able to partly address the issue. VPS providers generally have more information about the specific environment used to host your VPS, so it's a good idea to consult with a VPS provider for an issue like this.

    Could you verify if /etc/sysconfig/clock exists on this system, and if so, let us know the contents of that file?

    Thank you.
     
Loading...

Share This Page