Page 1 of 1

Date on the console view

Posted: Tue Nov 15, 2005 9:32 pm
by KorayPeksayar
Hello,
The date on the console view remains in British English despite of locale change.

This should be fixed in tis way:
Line 207 of the file zm_html_view_console.php should be changed as

Code: Select all

<td class="smallhead" align="left"><?= strftime( "%a %d %B, %I:%M %p"); ?></td>
The original line has the date statement. However date statements are not parsed for locale translation by PHP. Instead strftime() should be used.

Regards,
Koray

Posted: Tue Nov 15, 2005 11:19 pm
by zoneminder
Yes, you'll find date used extensively as it's a lot more flexible and has better options than strftime. However, as you have noticed, it isn't particularly locale friendly. I suspect that migration to full internationalisation is going to involve backwards steps in a number of areas unfortunately.

Phil

Posted: Tue Nov 15, 2005 11:34 pm
by KorayPeksayar
Phil, no. This is only for the displaying of the date, not for manipulating or db operations.

I have changed the code this way and it is good now :)

More to come :)

Koray

Posted: Tue Nov 15, 2005 11:37 pm
by KorayPeksayar
I forgot sth.

Both date and strftime work on UN*X timestamps.
You have used UN*X timestamps in the code for db operations and so any other formatting string with strftime would work in the meaning of date and time display.

Koray

Posted: Tue Nov 15, 2005 11:52 pm
by zoneminder
Unfortunately strftime neither does ordinals (e.g. 15th, 2nd, 3rd etc) or provides the facility to output hours etc as just single digits (where appropriate) not prefixed by spaces or zeroes.

So currently there are 43 instances of 'date' and only 22 of 'strftime' in the web interface. To be honest strftime is, and always has been, a nasty function and after years of struggling with it I was mightly relieved to come across date and it's more flexible options. So I generally use it exclusively except for the odd occasion where strftime was required. In general this means I use date for human readable date/times and strftime where fixed width set formats are required for database interaction etc but aside from the locale issues I think I could probably convert most of those calls to date.

Phil