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.

How to get Server timezone with WHM API?

Discussion in 'cPanel Developers' started by stephane02, Dec 22, 2011.

  1. stephane02

    stephane02 Member

    Joined:
    Dec 14, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I just need to get WHM server time using WHM API. Is it possible ?

    Thx for helping.
     
  2. faisikhan

    faisikhan Well-Known Member

    Joined:
    Dec 12, 2011
    Messages:
    88
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Islamabad, Pakistan
    cPanel Access Level:
    Root Administrator
    Hi

    I have also searched about it a lot & unfortunately the conclusion is there isn't any API for this yet. But you can get the time zone being displayed with a PHP script(Consult a Developer ). May be this can help you if you got any previous ideas about the .htaccess file;

    Here are the sample code for this if you want to use .htaccess file:

    You can set the timezone in .htaccess as well and can create a New File and name it ".htaccess", or you can edit the existing one. The .htaccess file belongs in /public_html/ or a subdirectory if for a subdomain or addon domain.

    Add the line: SetEnv TZ America/Indianapolis
     
  3. stephane02

    stephane02 Member

    Joined:
    Dec 14, 2011
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    If you read it again you'll see I mean getting server time not setting it. I just want to synchronize my plugin time with server time but it's not good at all that cPanel/WHM API didn't consider a single line about it...even server info api function
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Which programming language are you using? Most have a built-in function for this, hence I ask.
     
Loading...

Share This Page