What controls the log file time format ?

Forum for questions and support relating to the 1.29.x releases only.
Locked
User avatar
chevelle67
Posts: 16
Joined: Sun Jan 22, 2017 4:26 am

What controls the log file time format ?

Post by chevelle67 »

I was wondering what is controlling the log file time format seen here in my attached image of the /var/log/messages? I would like to change this to 12 hour time if possible.
Attachments
From Log
From Log
24 hour log time.png (10.02 KiB) Viewed 2537 times
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: What controls the log file time format ?

Post by SteveGilvarry »

Don't think there is an easy way, in fact not even sure if this field has any alternative format. A number of formats defined here.
https://github.com/ZoneMinder/ZoneMinde ... s/lang.php
But they can be overridden using the language file, check fr or hu in here for some examples of how to do that and try define an alternative in your language file (en_gb.php is English). These all live in the www folder of your zm install.
https://github.com/ZoneMinder/ZoneMinde ... r/web/lang

And the key for the codes.
http://php.net/manual/en/function.date.php

Let me know if it works, or if you need help hunting down why it doesn't work. I don't work on the PHP side much and this ajax log update even less so.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
User avatar
chevelle67
Posts: 16
Joined: Sun Jan 22, 2017 4:26 am

Re: What controls the log file time format ?

Post by chevelle67 »

Thanks for the info! I have done some basic code tweaking before and I kinda like PHP so this might be a fun task. I will keep you posted, may take me some time probably this weekend before I get a chance to do any real testing.
User avatar
chevelle67
Posts: 16
Joined: Sun Jan 22, 2017 4:26 am

Re: What controls the log file time format ?

Post by chevelle67 »

Update: My plan was to write a c program to search every .php file on my server for a str match on "TH:i:s.u" but for some reason my c program's perror ( filename ); gives me this error msg ": No such file or directory" even though they file and directories are there and I can open them up in nano. So presently I am at a bit of a standstill.
Locked