How to set the VM time?

Status
Not open for further replies.

nmangaoang

Joined
Jun 22, 2007
Messages
35
Reaction score
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
 
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?
 
Hi Mirzab,

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

Thanks,

Nick
 
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.
 
"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
 
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
 
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!
 
Hi Nmangaoang,

"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? "

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

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
[Date]
;date.timezone =
change to
[Date]
date.timezone = Asia/Hong_Kong

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
 
Hi 5qg4,

Your suggestion worked. :D Great!!!

Thank you very much!!!

Nick
 
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.
 
Hi 5qg4,

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

Thanks Again,

Nick
 
Status
Not open for further replies.

Forum statistics

Threads
111,910
Messages
589,690
Members
164,775
Latest member
Chester McTester