Home | Gifts |
%TIMESINCE%
,
%TIMESINCE{[[from]="..."] [to="..."]}%
Without arguments the time since the current topic has been created will be displayed.
Argument | Description |
---|---|
from="<time-experssion>" |
the starting time point, if ommited the current time |
to="<time-expression>" |
the ending timepoint, if ommited the current time |
units="1...7" |
number of time units to display, default 2; (example units="3": 2 months, 1 day and 3 minutes) |
seconds="on,off" |
switch on/off second precision |
null="<format-string>" |
to be displayed if the tim difference is null; defaults to "about now" |
format="<format-string>" |
format of the output, defaults to "$time", other usefull settings format="$time ago" , format="replied $time later" , "format="$time after the incident" |
negformat="<format-string>" |
use this format string if the time difference is negative |
-
, .
instead of /
in date, also .
instead :
in time
$time
expands to the calculated time difference
$percnt$
expands to a %
char
$dollar$
expands to a $
char
$n
expands to a linefeed
$t
expands to a tab space
$nop
expands to the empty string
You type | You get (simulated) | You get (if installed) |
---|---|---|
%TIMESINCE% | 1 day, 3 hours | 18 years, 9 months |
%TIMESINCE{format="topic was created $time ago" null="topic has just now been saved" units="4" }% | topic was created 1 day, 3 hours, 8 minutes ago | topic was created 18 years, 9 months, 2 weeks, 3 days ago |
%TIMESINCE{"11 Sep 2001 - 8:45" units="7" seconds="on"}% | 4 years, 2 months, 2 days, 5 hours, 50 minutes, 16 seconds | 23 years, 2 months, 1 week, 6 days, 1 hour, 41 minutes, 49 seconds |
%TIMESINCE{from="1955/04/18" to="1979-03-14" units="3"}% | 23 years, 11 months, 6 days | 23 years, 11 months, 6 days |
File: | Description: |
---|---|
data/TWiki/TimeSincePlugin.txt | plugin topic |
lib/TWiki/Plugins/TimeSincePlugin.pm | plugin perl module |
lib/TWiki/Plugins/TimeSincePlugin/Core.pm | plugin core |
configure
in your TWiki installation, and enable the plugin in the {Plugins} section.
Plugin Author: | TWiki:Main.MichaelDaum |
Copyright ©: | 2005-2008, Michael Daum http://michaeldaumconsulting.com |
License: | GPL (GNU General Public License) |
Plugin Version: | v1.10 |
Change History: | |
03 Jan 2008: | improved parsing time formats |
13 Oct 2006: | added negformat parameter |
31 Aug 2006: | added NO_PREFS_IN_TOPIC |
27 Apr 2006: | added lazy compilation |
11 Nov 2005: | Initial version |
TWiki Dependency: | $TWiki::Plugins::VERSION 1.1 |
CPAN Dependencies: | CPAN:Time::Local |
Other Dependencies: | none |
Perl Version: | 5.005 |
Benchmarks: | GoodStyle nn%, FormattedSearch nn%, TimeSincePlugin nn% |
Plugin Home: | Foswiki:Plugins/TimeSincePlugin |
Feedback: | TWiki:Plugins/TimeSincePluginDev |
Appraisal: | TWiki:Plugins/TimeSincePluginAppraisal |
Revision r0 - 2006-02-08 - 09:17:29 - TWikiContributor | Edit |