Posted on: 07/22/03 10:08pm
By: Hrekum
I feel like I have missed something very obvious, but I am clearly missing it. If I log into my site, I can change my Display Options and change the format of the datetime settings. I managed to add a new type to the table, but how on earth can I globally change the format so it will be that way for all users? I would love to be able to just change the story_date format... please help.
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 07/22/03 10:46pm
By: Anonymous (Interested)
Looks like you can change this in the config.php file.
This guy right here should do it, I think.
$_CONF[\'date\'] = \'%A, %B %d %Y @ %I:%M %p %Z\';
%A = Day of the week?
%B = Month (perhaps?)
%d = numeric day of month?
%Y = year?
%I = hour?
%M = minute?
%p = am or pm?
%Z = zone?
I\'d just fiddle around with this and see what happens.
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 07/23/03 03:38am
By: Dirk
Instead of guessing, why not try some good ol\' fashioned
reading?
bye, Dirk
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 07/23/03 10:22am
By: Hrekum
Hi Dirk
I had referenced the documentation previously, but I didn\'t see anything that explicitly told me what I needed to change. So I guess my next two questions are:
1. Does changing the format of $_CONF[\'date\'] in the config.php file change all date formats on the site, including \'story_date\'?
2. Is there any way of just changing the \'story_date\' format?
Thanks for your help and praise be to you and the team for creating such a great product.
Cheers
Chris
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 07/23/03 10:44am
By: Dirk
The \'story_date\' variable is formatted using $_CONF[\'date\'], unless the user has selected a date format other than \"System Default\" in his/her preferences.
Which date/time formatting is used where isn\'t really documented. If in doubt, you will have to look it up in the source ...
bye, Dirk
P.S. My \"instead of guessing\" comment was really addressed at \'Interested\'. The list of \'%\' formatting strings is copied straight out of the PHP manual, btw.
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 07/23/03 01:28pm
By: Anonymous (Michael)
Hi all,
i also have a problem with date - or date translation.
I\'m tring to set op GL on a site - so i\'m a rookie in GL
)
On the frontpage (and in the stories) the date (date and month) is always english - and i have edited in the config.php (se below) and \'installed\' the danish language-pack
)
[cut]
/ +---------------------------------------------------------------------------+
// | LOCALE SETTINGS |
// +---------------------------------------------------------------------------+
$_CONF[\'language\'] = \'danish\';
$_CONF[\'locale\'] = \'da-DK\';
$_CONF[\'date\'] = \'%A, %d. %B %Y @ %H:%M\';
$_CONF[\'daytime\'] = \'%%d/%m %H:%M\';
$_CONF[\'shortdate\'] = \'%x\';
$_CONF[\'dateonly\'] = \'%d-%b\';
$_CONF[\'timeonly\'] = \'%H:%M\';
$_CONF[\'default_charset\'] = \'iso-8859-1\';
$_CONF[\'rdf_language\'] = \'da-DK\'; // may have to be different than the locale
[end cut]
I have set up the date in Danish format and would like it also to display the name of the day and month in Danish. According to my Webhotel they have added AddLanguage da .dk in Apache.
Isn\'t in Apache the locale is set and is the syntax i wrote not correct??
I\'ve also tried \'da_DK\' and \'da.DK\' without luck
(
Thanks for any help
Regards,
Michael
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 07/23/03 01:46pm
By: Dirk
Try this little script to see if your server supports switching to the Danish locale:
<?php
echo \"<p>Default date format: \" . strftime (\"%A, %x\");
$result = setlocale (LC_ALL, \'da_DK\');
if ($result === false) {
echo \"<p>Error when changing locale\";
} else {
echo \"<p>Switched to locale $result, date format is now: \";
echo strftime (\"%A, %x\");
}
?>
If you get an \"Error when changing locale\" then you should contact your hosting service ...
bye, Dirk
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 10/12/03 09:59am
By: Anonymous (t.bag)
There is a list of possible date formats in the display preferences (dropdown) How can I add other formats to it i.e. where is this list stored?
Re:Default Date Display (aka changing the default story_date display settings)
Posted on: 10/12/03 10:25am
By: Anonymous (t.bag)
Got it, you just have to add the new format in the corresponding MySQL table (gb_dateformats) in case anyone wants to know.