How do I change the date format in 'Who's online', please? How do I change the date format in 'Who's online', please?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

How do I change the date format in 'Who's online', please?

Started by Johnfromhere, May 25, 2011, 12:52:49 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Johnfromhere

URL is www.metzbigband.co.uk/copp2 (but it is a private gallery).

I have only just noticed that the date in 'Who's online' is in US format :-
QuoteMost users ever online: 3 on 02/16/11 at 12:40

I have searched the documentation and this forum but cannot find anything that tells me where to alter it to British format.
Is there some kind soul out there who can put me out of my misery please?

Many thanks.

John.

Αndré

The date formats are defined in the language files. If you're using english_gb as default language, you have to add the following code block to that language file and adjust it to your needs:
// The various date formats
// See http://www.php.net/manual/en/function.strftime.php to define the variable below
$lang_date['album'] = '%B %d, %Y';
$lang_date['lastcom'] = '%m/%d/%y at %H:%M';
$lang_date['lastup'] = '%B %d, %Y';
$lang_date['register'] = '%B %d, %Y';
$lang_date['lasthit'] = '%B %d, %Y at %I:%M %p';
$lang_date['comment'] = '%B %d, %Y at %I:%M %p';
$lang_date['log'] = '%B %d, %Y at %I:%M %p';
$lang_date['scientific'] = '%Y-%m-%d %H:%M:%S';


I don't know the 'default' British language format(s), so maybe you want to help us to improve the British language file by suggesting some modifications.

Johnfromhere

Hi André

Many thanks for that.  I will have a go at altering it in the next few days and report back.

Thanks again.

John.

Johnfromhere

Hi André

I have had a play and now have it to my liking.

I finished up with :-

Quote$lang_date['album'] = '%d %b %Y';
$lang_date['lastcom'] = '%d %b %Y at %H:%M';
$lang_date['lastup'] = '%d %b %Y';
$lang_date['register'] = '%d %b %Y';
$lang_date['lasthit'] = '%d %b %Y at %I:%M %p';
$lang_date['comment'] = '%d %b %Y at %I:%M %p';
$lang_date['log'] = '%d %b %Y at %I:%M %p';
$lang_date['scientific'] = '%Y-%m-%d %H:%M:%S';

Which I think would probably suit most users of the english_gb file.

Many thanks for your help.

I have marked the posting 'solved'.

Cheers.

John.

Αndré

If some native British English speakers can confirm that data formats, I'll add it to the British language file.


roaftech

Quote from: Αndré on May 27, 2011, 10:15:03 AM
If some native British English speakers can confirm that data formats, I'll add it to the British language file.

As a native British English speaker (London-born, etc) I can confirm the date formats suggested are in common use in British English, although I prefer the following:
...
// The various date formats, derived from coppermine forum msg ref 350401
// See http://www.php.net/manual/en/function.strftime.php to define the variable below
// Principal dates set to UK format: DD/Mmm/YYYY HH:MM
$lang_date['album'] = '%d/%b/%Y';
$lang_date['lastcom'] = '%d/%b/%Y at %H:%M';
$lang_date['lastup'] = '%d/%b/%Y';
$lang_date['register'] = '%d/%b/%Y';
$lang_date['lasthit'] = '%d/%b/%Y at %H:%M';
$lang_date['comment'] = '%d/%b/%Y at %H:%M';
$lang_date['log'] = '%d/%b/%Y at %H:%M';
$lang_date['scientific'] = '%Y-%m-%d %H:%M:%S';
...
This seems to work fine on my site at
http://roaf.org/gallery/

Hope this is helpful.

Steve
.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery

phill104

Yes, I would agree with that. Most of us Brits are used to putting up with the American format which is probably why it was overlooked.

Andre,

I would suggest we go with Steve's suggestion for 1.5.18
It is a mistake to think you can solve any major problems just with potatoes.

Johnfromhere

I don't think I would argue with that  :).

Thanks.

Cheers.

John.

Αndré


roaftech

Quote from: Αndré on January 10, 2012, 11:13:37 AM
Added in SVN revision 8303.

Thanks Guys - it's encouraging to achieve everlasting fame with my first post!
.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery

phill104

It is a mistake to think you can solve any major problems just with potatoes.