Compatible with DokuWiki
Detritus, Hrun, Elenor of Tsort
This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.
This plugin gives you the possibilities of the strftime or date function. With the relative date/time formats for the strtotime function you can create any date/time output you want.
Search and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.
For development version, see Development.
{{date>%A: %d.%m.%y}}
Gives you the current date in format: Dayname: DayNumber.MonthNumber.Year E.g. When today is Christmas 2014, then the output is: Wednesday: 24.12.2014
{{date>D, d M Y H:i:s O|timestamp=mktime(18, 25, 0, 12, 02, 2014)|mode=date}}
Gives you: Tue, 02 Dec 2014 18:25:00 +0000
Basic syntax:
{{date>format|key1=value1|key2=value2...}}
Only format is required. All parameter are optional. The sequence of the optional parameters is not important.
values: Unix timestamp
You can use strtotime or mktime here.
values: Unix timestamp
You can use strtotime or mktime here.
{{date>%d.%m.|timestamp=strtotime('next monday')|now=strtotime('last saturday')}}
Please note:
{{date>%A: %d.%m.%y|timestamp=strtotime("+1 day")|now=strtotime("Monday this week")}}
and
{{date>%A: %d.%m.%y|timestamp=strtotime("+1 day",strtotime("Monday this week"))}}
give the same output. The now parameter redirects his value only when a strtotime in the timestamp value is used.
values: A category/locale name after RFC 1766/ISO 639
Set the locale LC_TIME information only for the plugin output.
{{date>%A: %d.%m.%y|locale=de_DE}}
So Christmas 2014 in Germany is on: Mittwoch: 24.12.2014
values: date
Use the date function instead the strftime function. By default the strftime function is used.
Fork me on Github and make Pull Requests. You can download preview Versions with this URL. Please note, that the preview versions maybe not fully stable.
See Github releases
Use the bugtracker on Github issues or email me.
The Unix time gives you the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970. It's a system for describing instants in time
Use strtotime or mktime or Unix Timestamp - Epoch Converter or a Unix Epoch Time Converter
The strtotime('Monday this week') switches the week on sunday. This is a bug in php: strtotime seems to use both sunday and monday as start of week
Use another relative date/time format, maybe with the now parameter.
locale key doesn't work. (Frusterick Manners)
(raspbian jessie + locale has been installed)
— dokufan Wed 22 Mar 07:27