How to change time zone?

Status
Not open for further replies.

qtph

New Member
Oct 30, 2022
26
0
1
I found time_zone field under Default Settings but no changes in CDR screen, still UTC. Should the whole system to be restarted before CDR time report changes?
Also time_format says 24-Hour but CDR shows in 12-Hour format.
 
As far as I know the default settings time zone entries are for specific device manufactures. If you want to set system time that is controlled by the OS you are running FusionPBX on.
 
I found time_zone field under Default Settings but no changes in CDR screen, still UTC. Should the whole system to be restarted before CDR time report changes?
Also time_format says 24-Hour but CDR shows in 12-Hour format.
Hello,
Try changing the time zone in your user settings. Keep your OS time always as UTC. This way each user can have their time zone set individually. I hope this helps.
 
Hello,
Try changing the time zone in your user settings. Keep your OS time always as UTC. This way each user can have their time zone set individually. I hope this helps.
Thank you, that is exactly what I ended up with. CDR now shows local time but 12/24 hours time display is most likely hardcoded there.
 
Default Setting: domain --> time_format --> text --> 24-Hour or 12-Hour
 
Yes, enabled. Dashboard shows time in 24 hour format but Call Detail Records in 12 hour format.
 
Ah yes, it's taken straight from the DB:

/var/www/fusionpbx/app/xml_cdr/xml_cdr_inc.php

PHP:
        $sql .= "to_char(timezone(:time_zone, start_stamp), 'DD Mon YYYY') as start_date_formatted, \n";
        $sql .= "to_char(timezone(:time_zone, start_stamp), 'HH12:MI:SS am') as start_time_formatted, \n";

Changing HH12 to HH24 should do it...and removing the 'am'.
 
  • Like
Reactions: Mikeme
Should code in xml_cdr_inc.php consult appropriate settings instead of hardcoding HH12?
 
If you're going to do a pull request and submit it, then yes that would be the correct thing to do. This was just a fast and dirty personal patch.
 
If you're going to do a pull request and submit it, then yes that would be the correct thing to do. This was just a fast and dirty personal patch.
The pull request part is beyond my current abilities. I would rather file a bug if there is a place for it.
 
Status
Not open for further replies.