%DATETIME{incdays="5"}% and will have a always coherent phrase.
%DATETIME{}% to show the current date and time in default date format (as set in configure).
For more options use: %DATETIME{"format" <optional parameters>}%
| Parameter | Description | Example |
|---|---|---|
"..." or format="..." |
Format of date string; see GMTIME{"format"} for formatting variables. Without setting the date explicitly, uses the current time and date. | %DATETIME{"$wday"}% |
language="..." |
Optionally localize the output. Supported languages are: English, Portuguese, Dutch. Overrides the LANGUAGE preference (which is currently set to: en). |
%DATETIME{"$wday" language="pt"}% |
date="..." |
Before formatting, set the date in one of the following formats: Default Foswiki format 31 Dec 2001 - 23:59 Foswiki format without time (defaults to 00:00) 31 Dec 2001 Date seperated by '/', '.' or '-', time with '.' or ':' Date and time separated by ' ', '.' and/or '-' 2001/12/31 23:59:59 2001.12.31.23.59.59 2001/12/31 23:59 2001.12.31.23.59 2001-12-31 23:59 2001-12-31 - 23:59 ISO format 2001-12-31T23:59:59 ISO dates may have a timezone specifier, either Z or a signed difference in hh:mm format. For example: 2001-12-31T23:59:59+01:00 2001-12-31T23:59Z The local timezone will be assumed. Seconds since 1970 (UNIX time) 1218930300 Note: will not handle dates before 1970! |
%DATETIME{date="2001/12/31"}% |
incdays="..." |
Increase the date by any number of days (may be a negative number) | %DATETIME{date="31 Dec 2001" incdays="1"}% |
inchours="..." |
Increase the date by any number of hours (may be a negative number) | %DATETIME{date="31 Dec 2001 - 07:00" format="$hours" inchours="-1"}% |
incminutes="..." |
Increase the date by any number of minutes (may be a negative number) | %DATETIME{date="31 Dec 2001" format="$minutes" incminutes="15"}% |
incseconds="..." |
Increase the date by any number of seconds (may be a negative number) | %DATETIME{date="31 Dec 2001" format="$seconds" incseconds="20"}% |
timezoneoffset="..." |
Increase the date by any number of hours (may be a negative number). Overrides the default value in configure. | %DATETIME{date="31 Dec 2001" format="$seconds" timezoneoffset="20"}% |
format. DateTimePlugin supports the following additional parameters:
| Parameter | Description | Example |
|---|---|---|
$month_long |
The long name of the month. | July |
$wday_long |
The long name of the day of the week. | Wednesday |
LANGUAGE to your language of choice, or use the DATETIME parameter language.
| Parameter | Description | Example |
|---|---|---|
$month with language="..." |
The localized short name of the month. | Out |
$month_long with language="..." |
The localized long name of the month. | Outubro |
$wday with language="..." |
The localized short name of the day of the week. | Seg |
$wday_long with language="..." |
The localized long name of the day of the week. | Segunda-feira |
| Deprecated parameter | Explanation | Suggestion |
|---|---|---|
$i_month |
The localized short name of the month. | Use $month with a language="..." setting. |
$i_lmonth |
The localized long name of the month. | Use $month_long with a language="..." setting. |
$lmonth |
The English long name of the month. | Use $month_long with a language="en" setting. |
$i_wday |
The localized short name of the day of the week. | Use $wday with a language="..." setting. |
$i_lwday |
The localized long name of the day of the week. | Use $wday_long with a language="..." setting. |
$lwday |
The English long name of the day of the week. | Use $wday_long with a language="en" setting. |
$sec |
Undocumented notation for seconds. | Use $seconds. |
$min |
Undocumented notation for minutes. | Use $minutes. |
$hour |
Undocumented notation for hours. | Use $hours. |
$day2 |
Undocumented notation for day. | Use $day. |
$seconds |
23 |
$minutes |
09 |
$hours |
01 |
$day |
03 |
$wday |
Seg |
$wday_long |
Segunda-feira |
$dow |
1 |
$week |
45 |
$month |
Nov |
$month_long |
Novembro |
$mo |
11 |
$year |
2025 |
$ye |
25 |
$tz |
GMT |
$iso |
2025-11-03T01:09:23Z |
$rcs |
2025/11/03 01:09:23 |
$http |
Mon, 03 Nov 2025 01:09:23 GMT |
$epoch |
1762132163 |
Yesterday was %DATETIME{"$day $month $year" incdays="-1"}%
results in:
Yesterday was Sunday, 02 Nov 2025
One week from now is %DATETIME{"$wday, $day $month $year" incdays="7"}%
results in:
One week from now is Mon, 10 Nov 2025
%DATETIME{
"Create TODO topic for tomorrow: [[ToDo$year$mo$day]] ($lwday, $day $lmonth)"
incdays="1"
}%
results in:
Create TODO topic for tomorrow: ToDo20251104 (Tuesday, 04 November)
{DateTimePlugin}.
{DateTimePlugin}{Debug} to 1.
configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
| Plugin Author: | TWiki:Main.AurelioAHeckert (2004), Foswiki:Main.ArthurClemens (2008, 2009) |
| Version: | 4740 |
| Release: | 1.2 |
| Change History: | |
| 31 Aug 2009 | 1.2 Arthur Clemens New features: • Added format parameter $epoch to pass seconds since 1970 (UNIX time). • Added parameter language. • Added parameter timezoneoffset. • Changed the 'localized' formatting parameters; now use language="..." to localize output. • Made configuration of localized strings in configure more coherent. • Completed unit test coverage. Bug fixes: • Fixed 'bug' in timezone offset that intentionally only uses the configure setting {TimezoneOffset} with current dates. To use a timezone offset with a set date, add parameter timezoneoffset. |
| 11 Mar 2009 | 1.1 Foswiki release |
| 28 Feb 2008 | 1.0 Arthur Clemens: Major rewrite to make this plugin compatible with (and use from) TWiki::Time. Localized language strings are now read from configure. |
| 27 Jul 2004 | 0.90 Aurelio A Heckert: First release |
| CPAN Dependencies: | none |
| Other Dependencies: | none |
| Perl Version: | 5.005 |
| License: | GPL (GNU General Public License) |
| Plugin Home: | http://foswiki.org/Extensions/DateTimePlugin |
| Support: | http://foswiki.org/Support/DateTimePlugin |