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.
 

NVT

New Member
Feb 23, 2022
8
1
3
36
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.
 

Robert Pasha

New Member
Jun 8, 2017
10
1
3
124
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.
 

qtph

New Member
Oct 30, 2022
26
0
1
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.
 

hfoster

Active Member
Jan 28, 2019
674
80
28
34
Default Setting: domain --> time_format --> text --> 24-Hour or 12-Hour
 

qtph

New Member
Oct 30, 2022
26
0
1
Yes, enabled. Dashboard shows time in 24 hour format but Call Detail Records in 12 hour format.
 

hfoster

Active Member
Jan 28, 2019
674
80
28
34
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

qtph

New Member
Oct 30, 2022
26
0
1
Should code in xml_cdr_inc.php consult appropriate settings instead of hardcoding HH12?
 

hfoster

Active Member
Jan 28, 2019
674
80
28
34
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.
 

qtph

New Member
Oct 30, 2022
26
0
1
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.