forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 plugins => Topic started by: Johnfromhere on May 25, 2011, 12:52:49 pm

Title: How do I change the date format in 'Who's online', please?
Post by: Johnfromhere on May 25, 2011, 12:52:49 pm
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 :-
Quote
Most 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.
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Αndré on May 25, 2011, 03:05:33 pm
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:
Code: [Select]
// 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.
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Johnfromhere on May 25, 2011, 06:01:16 pm
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.
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Johnfromhere on May 26, 2011, 06:26:20 pm
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.
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Α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.
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Johnfromhere on May 27, 2011, 04:55:32 pm
Thanks.
Title: Re: How do I change the date format in 'Who's online', please?
Post by: roaftech on January 06, 2012, 01:55:19 pm
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
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Phill Luckhurst on January 09, 2012, 03:46:43 pm
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
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Johnfromhere on January 09, 2012, 04:11:27 pm
I don't think I would argue with that  :).

Thanks.

Cheers.

John.
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Αndré on January 10, 2012, 11:13:37 am
Added in SVN revision 8303.
Title: Re: Re: How do I change the date format in 'Who's online', please?
Post by: roaftech on January 13, 2012, 04:59:50 pm
Added in SVN revision 8303.

Thanks Guys - it's encouraging to achieve everlasting fame with my first post!
Title: Re: How do I change the date format in 'Who's online', please?
Post by: Phill Luckhurst on January 13, 2012, 11:12:12 pm
And hopefully it will not be your last. ;)