Advanced search  

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

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

Johnfromhere

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

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: 15764
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: 77
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: 77
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: 15764
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: 77
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: 24
    • Romanian Aid Foundation
Re: How do I change the date format in 'Who's online', please?
« Reply #6 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
Logged
.
Steve Humphreys,
Help, Hope and Co-operation,
Asociatia Neemia, Dorohoi, Romania.
www.roaf.org/gallery

phill104

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

Johnfromhere

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 77
Re: How do I change the date format in 'Who's online', please?
« Reply #8 on: January 09, 2012, 04: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: 15764
Re: How do I change the date format in 'Who's online', please?
« Reply #9 on: January 10, 2012, 11:13:37 am »

Added in SVN revision 8303.
Logged

roaftech

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

phill104

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

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.023 seconds with 20 queries.