Advanced search  

News:

cpg1.5.36 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.34 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: How do I change the date format in 'Who's online', please?  (Read 7785 times)

0 Members and 1 Guest are viewing this topic.

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51

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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15171
Re: How do I change the date format in 'Who's online', please?
« Reply #1 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.
Logged

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Re: How do I change the date format in 'Who's online', please?
« Reply #2 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.
Logged

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Re: How do I change the date format in 'Who's online', please?
« Reply #3 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.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15171
Re: How do I change the date format in 'Who's online', please?
« Reply #4 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.
Logged

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Re: How do I change the date format in 'Who's online', please?
« Reply #5 on: May 27, 2011, 04:55:32 PM »

Thanks.
Logged

roaftech

  • Coppermine novice
  • *
  • Country: ro
  • Offline Offline
  • Gender: Male
  • Posts: 23
    • Romanian Aid Foundation
Re: How do I change the date format in 'Who's online', please?
« Reply #6 on: January 06, 2012, 02: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
Logged
.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4281
    • Windsurf.me
Re: How do I change the date format in 'Who's online', please?
« Reply #7 on: January 09, 2012, 04: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
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 51
Re: How do I change the date format in 'Who's online', please?
« Reply #8 on: January 09, 2012, 05:11:27 PM »

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

Thanks.

Cheers.

John.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15171
Re: How do I change the date format in 'Who's online', please?
« Reply #9 on: January 10, 2012, 12:13:37 PM »

Added in SVN revision 8303.
Logged

roaftech

  • Coppermine novice
  • *
  • Country: ro
  • Offline Offline
  • Gender: Male
  • Posts: 23
    • Romanian Aid Foundation
Re: Re: How do I change the date format in 'Who's online', please?
« Reply #10 on: January 13, 2012, 05:59:50 PM »

Added in SVN revision 8303.

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

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4281
    • Windsurf.me
Re: How do I change the date format in 'Who's online', please?
« Reply #11 on: January 14, 2012, 12:12:12 AM »

And hopefully it will not be your last. ;)
Logged
It is a mistake to think you can solve any major problems just with potatoes.
Pages: [1]   Go Up
 

Page created in 0.078 seconds with 20 queries.