How does it work?
Dynamic Dates uses PHP’s strtotime() function to parse natural language into relative timestamps. For example, two years from now is “+2 year” and Canadian Thanksgiving is the “second monday of october” . Browse the full strtotime() reference to find other possibilities.
How can I display a simple date?
Use one of the built-in shortcodes:
[now], [yesterday], [today], [tomorrow], [last-month], [this-month], [next-month], [last-year], [this-year], [next-year]
See live examples at my website.
How can I display a customized date?
This is a very powerful feature. Use any shortcode, or the generic [date] shortcode, and extend it with the following attributes, each of which is optional:
- format – a pattern to format the date or time. Browse the different formatting codes for English mode and International mode.
- time – the date or time specified with natural language
- relative_to – a date or time that the first time is “relative to”, also specified with natural language
- timezone – a timezone to display (the default is set in the WordPress settings (requires PHP 5.2 or higher)
- language – a language to use (requires PHP 5.3 or higher)
‘English Mode’ advanced examples:
It’s Sunday 15:58:47 in Paris, France
[date format="l H:i:s" timezone="Europe/Paris"]
Canadian Thanksgiving is October 12th this year and October 10th next year
[date format="F jS" time="second monday of october"]
[date format="F jS" time="second monday of october" relative_to="next year"]
‘International Mode’ advanced examples:
Voy a la fiesta el viernes 22 de marzo
`[date format="d de MMMM" "time="friday" language="es_CL"]`
See live examples at my website.