Page 1 of 1

date format problem

Posted: Wed Feb 06, 2019 2:51 pm
by zd59
This is more than a decade old problem:
In Zoneminder the date format is fixed to YYYMMDD in a logs and events listing. There is no way to change it to locale f.i. DDMMYYYY.
Take look here:viewtopic.php?f=38&t=27534&p=107165&hil ... le#p108583
And no one is willing even to answer.

The worse is a current master GIT:
Default language en_GB, file ../zm/lang/en_GP.php
when activate (remove // at line start) setlocale ( LC_TIME, 'en_GB');
The web GUI stops working (localhost is currently unable to handle thist request)
So no change in a locales (en_GB is default anyway) and GUI stops working.

In a name of all non American users I please the developer to correct this.

Re: date format problem

Posted: Wed Feb 06, 2019 5:37 pm
by mikb
Disclosure: I'm non-American too.

Personally, if any date formats are going to be hard coded in and enforced, I would much rather see YYYYMMDD enforced absolutely everywhere, because it is unambiguous, and naturally sorts correctly.

Using DDMMYYYY vs MMDDYYYY in a "who's right, America or UK?" battle leaves everyone wondering what the date is. It is ambiguous, open to mis-reading, it translates badly. It sorts idiotically.

Using DDMMYY or any other combination with two digit years is really slack, given we know what happened around the millennium bug, and makes the confusion worse.

:)

Re: date format problem

Posted: Thu Feb 07, 2019 1:13 pm
by zd59
With all respect mikb:

Do not mix computer stored data and data presented to humans by computers.

I agree, that date stored in computers must be YYYYMMDD. This is understandable for a reasons you wrote.
But data presented to humans is another story. There are many nations on the world with different standards for data presentation (locales).

All computer operating systems have a way to adjust data on screen and paper to locale preferences. Some user programs take into account system OS settings, some do that on its own way. But as it is seen on that forum, zoneminder date is "en_US" only from 2006. With honorary exception "Timestamp Label Format" in monitor section, where it works.

I'm trying to point out this unpleasant feature, not fixed for more than a decade. Scripts and language files are there but do not work. :cry:

Re: date format problem

Posted: Thu Feb 07, 2019 3:12 pm
by rockedge
wasn't the original programmer / creator of ZM British?

Re: date format problem

Posted: Thu Feb 07, 2019 3:18 pm
by iconnor
As one of the core developers, let me say that I agree that ZoneMinder should fully respect and be configurable to display dates and times in whatever format the user requires.

However there is a lot of work to do and I don't know when I will get to it.

I will be very happy to review and help with code and PR submissions.

Re: date format problem

Posted: Thu Feb 07, 2019 6:03 pm
by mikb
zd59 wrote:
Thu Feb 07, 2019 1:13 pm
Do not mix computer stored data and data presented to humans by computers.
I'm not mixing them up. As a human, I find it utterly baffling when programs present data in formats that make it hard to understand. So the formats I mentioned such a "05 02 19", which is the 5th of February this year, 2nd of May this year, 19th of February 14 years ago etc. etc.... are a nuisance.

Or times that pretend to be in 24 hour format, by using a leading zero, then adding a "pm". E.g. 09:34 pm ... Do you mean 21:34? Or 9:34 pm?
zd59 wrote:
Thu Feb 07, 2019 1:13 pm
All computer operating systems have a way to adjust data on screen and paper to locale preferences.
Thanks for the lesson. If you'd read what I wrote, I said *if* there is going to be one enforced way, *that* is the way to do it.

I'm sure the developers are well aware of this stuff, but have other priorities.

Re: date format problem

Posted: Sat Feb 09, 2019 5:35 pm
by zd59
iconnor wrote:
Thu Feb 07, 2019 3:18 pm
As one of the core developers, let me say that I agree that ZoneMinder should fully respect and be configurable to display dates and times in whatever format the user requires.

However there is a lot of work to do and I don't know when I will get to it.

I will be very happy to review and help with code and PR submissions.
Thank you iconnor for expected answer.
I'm aware all of you developers are very busy, as this is a free time project and this is a low priority item.
I will be very glad to help to debug, dig in the code, searching for a solution. I don't know where to start.
Usable debug output would be the start. So I'll set all options to max debug and try.

Currently when set an option in a language file:
setlocale( LC_TIME, 'en_GB' ); the GUI shut down and do not start:
"currently unable to handle this request"
And en_GB is selected in a settings as a language default.
And when I set other language default, the language changes but date display is always american YYYYMMDD. Looks LC_TIME is not used, but set in language file confuses zoneminder so much, it switch off GUI.