Discussion about the date and time-format (not) used in wikka


Date formatting

Hi folks,

trying to figure out how to change the date format displayed in Page History and Revisions to something more functional than the "Romance Daylight Time" I get in my wikka installation. Could someone point me in the right direction please? Thanks for a really good wiki btw!

--EgilHelland

In handlers/page/revisions.php replace
$output .= "<td>&nbsp;<a href=\"".$this->Href("show","","time=").urlencode($page["time"])."\">".$page["time"]."</a></td>";

with something like
$output .= "<td>&nbsp;<a href=\"".$this->Href("show","","time=").urlencode($page["time"])."\">".date("l dS of F Y h:i:s A",strtotime($page["time"]))."</a></td>";

in handlers/page/history.php replace
$output .= "<strong>Edited on <a href=\"".$this->Href("", "", "time=".urlencode($pageA["time"]))."\">".$pageA["time"]."</a> by ".$EditedByUser."</strong> <span style=\"color:#888;font-size:smaller;\">".$note."</span><br />\n";

with something like
$output .= "<strong>Edited on <a href=\"".$this->Href("", "", "time=".urlencode($pageA["time"]))."\">".date("l dS of F Y h:i:s A",strtotime($pageA["time"]))."</a> by ".$EditedByUser."</strong> <span style=\"color:#888;font-size:smaller;\">".$note."</span><br />\n";

See php documentation for details on the date() function.
I think it would be nice to add a function for this to the wikka-class and call it everywhere, where times are printed out - would make such things a bit easier (especially if there would be a $DefaultTimeFormat in the config-array).
--TimoK


Standard date and time format
Although I'm all for using the ISO date/time format as we see in the timestamp of the footer of every page, I note that several other parts of Wikka use different date/time formats. I'd like to see an approach where this is standardized.
Proposal:

I realize that in principle it's possible to pick up formats from a locale but for a Wikka targeted at an international audience this may not be the best approach, and for a Wikka with a "local" audience it may not be either if it's hosted on a (public) server outside that country - hence the idea to define a format in the configuration.
--JavaWoman



CategoryDevelopmentFormatters
Comments
Comment by 216.254.119.233
2006-03-02 14:53:06
How do you change the time zone? It appears the default is PST
Comment by NilsLindenberg
2006-03-03 12:51:13
Thats a good question. I will have to look deeper into the code, but I fear it is based on the local time of the server the wikka is running on and therefore not very easy to change.
Comment by 82.181.144.232
2006-03-31 05:32:40
This is really weird.
I tried changing GetPageTime() in wikka.php to return date ('d.m.Y', $this->page["time"]);
but that shows the start of the Unix epoch. Are we really storing somekind of formatted string instead of a timestamp in the DB? Can't check right now myself....
Comment by NilsLindenberg
2006-03-31 09:27:14
The 'time' field is set to the type 'datetime' (like 2006-03-30 21:16:53).
Comment by DavePreston
2006-11-16 06:25:16
This may have been covered elsewhere, but I would really like to see a configurable 'time offset' available. My wiki is hosted in the US, but the site is aimed at a UK audience and a way to simply add 6 hours (or whatever) to any times would be most useful.
Comment by DarTar
2006-11-17 05:01:31
Hi Dave, this request is already in our tracker http://wush.net/trac/wikka/ticket/252 although not among our short-term priorities, unless some developer/contributor wants to work specifically on this. Thanks for bumping this page :)
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki