Date/Time plugin for ExpressionEngine
The DT Plugin displays dates with formatting and allows you to add days, months, years to the current date or a static date you set.
New: composer installer
composer require jjpmann/ee-dt
Read more about this here
Old: manual
move files into 'dt' folder inside of system/user/addons
Will return the date formatted this way: MM/DD/YYYY
Tag pair used to wrap around entries loop to adding custom dates in to parameters
All of these are optional
Sets the static date that the other parameters will reference. If not set will default to the current date.
{exp:dt set="01/01/2010"}
Sets the format of the returned date using the following parameters: http://expressionengine.com/user_guide/templates/date_variable_formatting.html
{exp:dt set="11/03/90" ee_format="true" format="%l %M %j, %Y"}
Outputs: Saturday Nov 3, 1990
if set to 'false'dt will parse the date using php formating: http://php.net/manual/en/function.strftime.php
{exp:dt set="11/03/90" format="%A %B %e, %Y"}
Outputs: Saturday November 3, 1990
Translates based on system languages
-
fr_FR : French
-
es_ES : Spanish
-
nl_NL : Dutch
{exp:dt set="11/03/90" language="es_ES" format="%A %b %e, %Y"}
Outputs: sábado noviembre 3, 1990
Adds or subtracts a value in days to current/set date.
Adds or subtracts a value in months to current/set date.
Adds or subtracts a value in years to current/set date.
{exp:dt day="3" month="1" year="-1" set="1/1/2010"}
Outputs: 02/04/09
Adds or subtracts a value in hours to current/set date.
Adds or subtracts a value in minutes to current/set date.
Adds or subtracts a value in seconds to current/set date.
Now: {current_time format="%m/%d/%y"} <br>
{exp:dt set='third saturday of this month'} == {current_time format="%m/%d/%y"}<br>
{if '{exp:dt set="first monday of this month"}' == '{current_time format="%m/%d/%y"}'}
YAY
{/if}