We relaunched the TWiki.org project with an expanded TWiki charter, and we invite you to participate! The TWiki.org Code of Conduct agreement took effect on 27 Oct 2008. We ask existing twiki.org users to opt-in. -- PeterThoeny - 27 Oct 2008
You are here: TWiki> Codev Web>FormatTime (31 Aug 2004, PeterMasiar)
Tags:
create new tag
, view all tags

Implemented: New TWiki::Func::formatTime Function to Format Time into a String

formatTime( $time, $format, $timezone ) ==> $text

Description: Format the time in seconds into the desired time string
Parameter: $time Time in epoc seconds
Parameter: $format Format type, optional. Default e.g. " TWiki::Plugins::VERSION 1.010 (31 Dec 2002) - 19:30", can be "iso" (e.g. "2002-12-31T19:30Z"), "rcs" (e.g. "2001/12/31 23:59:59", "http" for HTTP header format (e.g. "Thu, 23 Jul 1998 07:21:56 GMT")
Parameter: $timezone either not defined (uses the displaytime setting), "gmtime", or "servertime"
Return: $text Formatted time string
Note: if you used the removed formatGmTime, add a third parameter "gmtime"
Since: TWiki::Plugins::VERSION 1.020 (26 Feb 2004)

-- SvenDowideit - 26 Feb 2004

Discussions

Added docs of feature added on 26 Feb 2004 by SvenDowideit.

-- PeterThoeny - 29 Aug 2004

I was hoping to add yet another format: age, or time difference. Sometimes all you need is how old most recent change is - if it is minutes or hours, display age in munutes/hours. If it is old (days), display date, without hours.

-- PeterMasiar - 31 Aug 2004

 
Topic revision: r3 - 31 Aug 2004 - 14:14:42 - PeterMasiar
Codev.FormatTime moved from Codev.FuncFormatTime on 29 Aug 2004 - 08:31 by PeterThoeny - put it back
 
TWIKI.NET
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback