How to set the VM time?

Discussion in '3CX Phone System - General' started by nmangaoang, Aug 10, 2007.

  1. nmangaoang

    Joined:
    Jun 22, 2007
    Messages:
    35
    Likes Received:
    0
    Hi,

    How can I change or set the time on the VM?
    When I retrieve messages the time envelope is not correct.

    Please help.

    Thanks,

    Nick
     
  2. Mirzab

    Mirzab Member

    Joined:
    Jul 22, 2007
    Messages:
    400
    Likes Received:
    0
    Now don't hold me to this but I was under the impression that the time is derived from the PC's current settings - did you check time on PC?
     
  3. nmangaoang

    Joined:
    Jun 22, 2007
    Messages:
    35
    Likes Received:
    0
    Hi Mirzab,

    Yes I checked the time on the PC. The VM time is different from the PC time.

    Thanks,

    Nick
     
  4. gbarnes

    Joined:
    Aug 3, 2007
    Messages:
    83
    Likes Received:
    0
    Not tested this but:

    Edit the file Globals.php in the directory data/ivr/vxml directory where 3cx is installed, usually program files. Now find the function below and add the fix. Its a lot easier than setting zones in php.

    Remove the // (comment lines) for the result you want, then save the file. But you had better back it up just in case.

    function GetTime()
    {
    list($usec, $sec) = explode(" ", microtime());
    // TIME FIX (ADD THIS HERE)
    // ADD ONE HOUR
    // $sec+= 3600 ;
    // LESS ONE HOUR
    // $sec-= 3600;
    return (float)$sec + (float)$usec;
    }

    From what I can see thats how the system gets and saves the VM times. Are you times out by whole hours, eg no minutes difference?

    Graeme.
     
  5. nmangaoang

    Joined:
    Jun 22, 2007
    Messages:
    35
    Likes Received:
    0
    "From what I can see thats how the system gets and saves the VM times. Are you times out by whole hours, eg no minutes difference? "

    Hi Graeme,

    Yes you are right.
    I'll try your suggestion and let you know the result.

    Thanks a lot,

    Nick
     
  6. nmangaoang

    Joined:
    Jun 22, 2007
    Messages:
    35
    Likes Received:
    0
    Hi Graeme,

    I haven't changed it yet. The time is late by 8 hours.

    The original program looks like this.

    function GetTime()
    {
    list($usec, $sec) = explode(" ", microtime());
    return (float)$sec + (float)$usec;
    }

    Should I change to this?
    function GetTime()
    {
    list($usec, $sec) = explode(" ", microtime());
    ADD EIGHT HOUR
    return (float)$sec + (float)$usec;
    }

    Thanks,
    Nick
     
  7. RobLloyd

    RobLloyd Member

    Joined:
    Oct 13, 2006
    Messages:
    488
    Likes Received:
    0
    I just checked 2 servers and the VM time is correct and is in sync with the OS time.

    I have a client with the correct VM time but his phone is not correct -01/21/07 and no where near the correct time. Yet other phones, same model, and same settings in his office are correct. Linksys does it again!
     
  8. 5qg4

    5qg4 Active Member

    Joined:
    Jan 31, 2007
    Messages:
    643
    Likes Received:
    0
    Hi Nmangaoang,

    It seems PHP's Time Zone issue. The current version of PHP should be using default timezone GMT+0. If your timezone GMT+8, it will be 8 hour behind and no difference between sec. and mins.

    If I'm right. The solution should be update "date.timezone = Asia/Hong_Hong" at C:\Program Files\3CX PhoneSystem\Bin\Apache\php.ini file .
    From
    change to
    Since I cannot find the time zone for your region. "Asia/Hong_Kong" should be GMT+8 same as you. Please try and let us know the result. It's works for me. Please find the timezone table for who in need.

    http://www.php.net/manual/en/timezones.php
     
  9. nmangaoang

    Joined:
    Jun 22, 2007
    Messages:
    35
    Likes Received:
    0
    Hi 5qg4,

    Your suggestion worked. :D Great!!!

    Thank you very much!!!

    Nick
     
  10. 5qg4

    5qg4 Active Member

    Joined:
    Jan 31, 2007
    Messages:
    643
    Likes Received:
    0
    Hi Nmangaoang,

    Good to hear it works for you as well. If your don't like to using "Asia/Hong_Kong", you may try to use "Etc/GMT+8" instead.
     
  11. nmangaoang

    Joined:
    Jun 22, 2007
    Messages:
    35
    Likes Received:
    0
    Hi 5qg4,

    No need to change. It doesn't matter since it is working fine.

    Thanks Again,

    Nick
     

Share This Page