Welcome to Geeklog, Anonymous Wednesday, April 17 2024 @ 08:11 pm EDT

Geeklog Forums

Local date


Status: offline

broelling

Forum User
Junior
Registered: 04/30/02
Posts: 23
I'm using the visitorstats block by Mr.GxBlock, and I'm very pleased with it. However - I can't seem to get it to understand that it should be looking for my locale (Denmark), before it publishes any long month or days names. How can I get it to use the config.php variables for days and months instead of this, so it knows it's in Denmark!?? Code in the phpblock_newstats() function: $dayofweek=date("l"Wink; $month=date("F"Wink; $day=date("d"Wink; $year=date("Y"Wink; $hour=date("H"Wink;
I'd rather be good than clever - I'd rather have all facts wrong, than no reply whatever...
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany

To quote from the PHP manual for date:

To format dates in other languages, you should use the setlocale() and strftime() functions.

In other words: You have to replace those date() calls with the corresponding calls to strftime() (Geeklog already calls setlocale() for you).

bye, Dirk

 Quote

Status: offline

broelling

Forum User
Junior
Registered: 04/30/02
Posts: 23
Thanx... Thinking about it, I guess I knew that - but my brain must be on standby since new years eve...---I'd rather be good than clever - I'd rather have all facts wrong, than no reply whatever...
I'd rather be good than clever - I'd rather have all facts wrong, than no reply whatever...
 Quote

All times are EDT. The time is now 08:11 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content