Error HTTP500 after changing datetime format

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
jhn
Posts: 11
Joined: Thu Nov 12, 2020 6:38 pm

Error HTTP500 after changing datetime format

Post by jhn »

Hello,

I have an issue with ZoneMinder since I tried to change date, time and datetime format trough "Options".
There is no more interface, but a "500 Internal Server Error".

I found perhaps a missing Timezone trouble (https://github.com/ZoneMinder/zoneminder/issues/2895) but cannot fix it by added

Code: Select all

define( 'ZM_TIMEZONE', 'Europe/Paris' );
into "/usr/share/zoneminder/www/index.php" or "/usr/share/zoneminder/www/includes/config.php" and restart zoneminder service.

ZoneMinder log file ("/var/log/apache2/error.log") return

Code: Select all

[php:error] [pid 375671] [client 127.0.0.1:44472] PHP Fatal error:  Uncaught Error: Call to undefined method IntlDateFormatter::setPatter() in /usr/share/zoneminder/www/index.php:58\nStack trace:\n#0 {main}\n  thrown in /usr/share/zoneminder/www/index.php on line 58, referer: http://localhost/zm/index.php?view=watch&mid=8
If someone have an idea about change timezone or change back time format I will be very gratefully.

Thanks
User avatar
burger
Posts: 476
Joined: Mon May 11, 2020 4:32 pm

Re: Error HTTP500 after changing datetime format

Post by burger »

See:
https://wiki.zoneminder.com/MySQL#Example_Queries
https://wiki.zoneminder.com/MySQL#Searc ... _an_Option

Code: Select all

[zm]> select * from Config where Name like '%ZONE%'\G
*************************** 1. row ***************************
          Id: 43
        Name: ZM_TIMEZONE
       Value: 
        Type: string
DefaultValue: 
        Hint: America/Toronto
     Pattern: (?^:^(.+)$)
      Format: $1
      Prompt: The timezone that php should use.
        Help: 
      This should be set equal to the system timezone of the mysql server
    Category: system
    Readonly: 0
     Private: 0
      System: 0
    Requires: NULL
1 row in set (0.001 sec)
To update it use:

Code: Select all

update Config set ZM_TIMEZONE = America\Toronto;
And restart Zoneminder.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
jhn
Posts: 11
Joined: Thu Nov 12, 2020 6:38 pm

Re: Error HTTP500 after changing datetime format

Post by jhn »

Hello,

Thanks for your reply !
I can get into mysql database, but cannot change timezone

Code: Select all

ERROR 1054 (42S22): Unknown column 'Config.ZM_TIMEZONE' in 'field list'
Do you have any idea ?

Thanks
jhn
Posts: 11
Joined: Thu Nov 12, 2020 6:38 pm

Re: Error HTTP500 after changing datetime format

Post by jhn »

But its look like I have a timezone

Code: Select all

*************************** 1. row ***************************
          Id: 43
        Name: ZM_TIMEZONE
       Value: Europe/Paris
        Type: string
DefaultValue: 
        Hint: America/Toronto
     Pattern: (?^:^(.+)$)
      Format: $1
      Prompt: The timezone that php should use.
        Help: 
      This should be set equal to the system timezone of the mysql server
    Category: system
    Readonly: 0
     Private: 0
      System: 0
    Requires: NULL
1 row in set (0,00 sec)
jhn
Posts: 11
Joined: Thu Nov 12, 2020 6:38 pm

Re: Error HTTP500 after changing datetime format

Post by jhn »

I find a solution !

Instead to change timezone, I remove the 3 pattern of date, time and datetime.

Code: Select all

*************************** 1. row ***************************
          Id: 5
        Name: ZM_DATE_FORMAT_PATTERN
       Value: 
        Type: string
DefaultValue: 
        Hint: string
     Pattern: (?^:^(.+)$)
      Format:  $1 
      Prompt: Date format override
        Help: Pattern to use to override the format string used for dates.
      Leave it empty to use the defaults for the set locale.
      See [unicode-org](https://unicode-org.github.io/icu/userguide/format_parse/datetime/) for values.
      
    Category: system
    Readonly: 0
     Private: 0
      System: 0
    Requires: NULL
*************************** 2. row ***************************
          Id: 7
        Name: ZM_DATETIME_FORMAT_PATTERN
       Value: 
        Type: string
DefaultValue: 
        Hint: string
     Pattern: (?^:^(.+)$)
      Format:  $1 
      Prompt: Date/time format override
        Help: Pattern to use to override the format string used for dates
      and times. Leave it empty to use the defaults for the set locale.
      See [unicode-org](https://unicode-org.github.io/icu/userguide/format_parse/datetime/) for values.
      
    Category: system
    Readonly: 0
     Private: 0
      System: 0
    Requires: NULL
*************************** 3. row ***************************
          Id: 6
        Name: ZM_TIME_FORMAT_PATTERN
       Value: 
        Type: string
DefaultValue: 
        Hint: string
     Pattern: (?^:^(.+)$)
      Format:  $1 
      Prompt: Time format override
        Help: Pattern to use to override the format string used for times without dates.
      Leave it empty to use the defaults for the set locale.
      See [unicode-org](https://unicode-org.github.io/icu/userguide/format_parse/datetime/) for values.
      
    Category: system
    Readonly: 0
     Private: 0
      System: 0
    Requires: NULL
3 rows in set (0,00 sec)
The interface work again !

Thanks for your help.
Post Reply