Freepbx 17 Time is off

On the host server the time is correct as local EST time. The log shows the correct time from the web log view or from asterisk. However, CDR report and time condition show the time as local server time + 4hrs? The time zone is set to New York. Shoud I just set the zone to GMT since the server is local?

Did you reboot the server after setting the time zone? It’s a critical step.

Did a reboot last night and it is still off??
Any thing else i can look at before I change the TZ??

If I were recording CDRs I would record them in UTC. Are you sure that isn’t what FreePBX does normally?

If you don’t use UTC it becomes difficult to handle calls during daylight saving time transitions, or in businesses that span multiple time zones.

Set the time zone in System Admin. Reboot. That should be all.

Don’t forget everyone there’s two time settings involved with this. First, there is the actual server time and then there is the PHP time zone. The first is what you expect, the system time and time zone while the latter is the time zone used when things are processed through PHP.

Everything in the GUI will use the PHP time zone, all the PHP scripts that are run as cron jobs use the PHP time zone (wakeup calls, time conditions, etc). The CDR/CEL records would be written to the database in the system time zone (or whatever the CDR/CEL configs use) but viewing them in the GUI would have the time/dates set by the PHP time zone.

So at the system level (Debian 12) it’s:

timedatectl #shows details
root@fpbx17:~# timedatectl  
               Local time: Tue 2025-06-03 12:09:14 UTC
           Universal time: Tue 2025-06-03 12:09:14 UTC
                 RTC time: Tue 2025-06-03 12:09:14
                Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

List time zones and set time zone, also using this method never requires a reboot why the more current and modern way of handling this in Debian 12 isn’t used, I don’t know.

timedatectl list-timezones  #lists time zones
timedatectl set-timezone America/New_York #sets system time zone

Now you also have in Advanced Settings:
SCR-20250603-bk3

As well in the cel_odbc.conf and cdr_adaptive_odbc.conf (or even cdr_odbc.conf) you can use the setting usegmtime by default it’s “no” so it uses the system time but if you set it to “yes” it always stores the record with GMT time/date.

Finally, things like Time Conditions let you select the PHP time zone you want to use for that particular Time Condition. Meaning your office in NY can have a different time condition matching NY time zone while the office in CA can have America/Los_Angeles as its time zone.

1 Like

Ok that was good information and here is what i see

root@PBX17:~# timedatectl #shows details
Local time: Tue 2025-06-03 23:19:10 EDT
Universal time: Wed 2025-06-04 03:19:10 UTC
RTC time: Wed 2025-06-04 03:19:10
Time zone: America/New_York (EDT, -0400)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no

PHP Timezone is set to US/Eastern

Time Zone is America New_York

So what exactly do I need to change to get the CDR reports right?

The PHP Time? What is that set to?

PHP Timezone is set to US/Eastern