Dotiac::DTL::Tag::now - The {% now FORMAT %} tag
Template file:
{% now "d. o\f F Y \a\t P %} {# 03. of May 1999 at 12:30 a.m. #}
Gives the current time and a specific FORMAT to the date filter (See L<Dotiac::DTL::Filter>). This will result in the current time being formatted according to the specified FORMAT.
You can combine as many of these as you like or need:
{% now "d. b." %}
Returns the next character, regardless if it is a format character or not.
{% now "\H\e\l\l\o \W\o\r\l\d" %} {# =Hello World #}
This also means "\n" will in this case render an "n" and NOT a newline. Same for "\t","\f","\b","\r".
Returns whether it is AM or PM in Associated Press style: "a.m." or "p.m".
{% now "a" %} {# a.m. on in the morning#}
This might change if a locale module is loaded.
Returns AM or PM.
{% now "A" %} {# AM #}
Returns the current month in 3 lowercase letters.
{% now "b" %} {# dec #}
Returns the day of the month with a leading zero.
{% now "d" %} {# 01 #} to {# 31 #}
Returns the day of the week in 3 letters (2 letters on some locales)
{% now "D" %} {# Sun #}
Returns the time with hours and minutes, but minutes are left out if they are 0.
{% now "f" %} o'clock {# 11:30 o'clock #} {# 3 o'clock #}
Returns the month in long form.
{% now "F" %} {# December #}
Returns the hour in 12-hour format without leading zeros.
{% now "g" %} {# 1 #} to {# 12 #}
Returns the hour in 24-hour format without leading zeros.
{% now "G" %} {# 0 #} to {# 24 #}
Returns the hour in 12-hour format with a leading zero.
{% now "h" %} {# 01 #} to {# 12 #}
Returns the hour in 24-hour format with a leading zero.
{% now "H" %} {# 00 #} to {# 24 #}
Returns the minutes with a leading zero.
{% now "i" %} {# 00 #} to {# 60 #}
Returns the day of the month without leading zeros.
{% now "j" %} {# 1 #} to {# 31 #}
Returns the day of the week as a long text.
{% now "l" %} {# Sunday #}
Returns 1 or 0 whether it's a leap year.
{% now "L" %} {# 1 #}
Not that needed with now, but with the date filter
Returns the current month as a number with leading zeros.
{% now "m" %} {# 01 #} to {# 12 #}
Returns the current month in 3 letters.
{% now "M" %} {# Dec #}
Returns the current month as a number without leading zeros.
{% now "m" %} {# 1 #} to {# 12 #}
Returns the current in Associated Press style notation.
{% now "M" %} {# Jan. #} {# March #} {# July #}
Returns the difference to Greenwich time in hours.
{% now "O" %} {# +0100 #}
Returns either the time in 12 hours and minutes if not zero with a.m. or p.m., midnight or noon.
{% now "P" %} {# 1 p.m. #} {# 11:56 a.m. #} {# midnight #} {# noon #}
Returns an RFC 2822 formatted date.
{% now "r" %} {# Sun, 28 Dec 2008 18:36:24 +0200' #}
Returns the seconds with a leading zero.
{% now "s" %} {# 00 #} to {# 59 #}
Returns the ordinal suffix for the day of the month.
{% now "S" %} {# st #} {# nd #} {# rd #} {# th #}
Defaults to english, this may change if a locale module is loaded.
Returns the number of days in the given month.
{% now "t" %} {# 28 #} to {# 31 #}
Returns the current timezone (needs the POSIX module)
{% now "T" %} {# CET #} {# GMT #} {# EST #}...
Returns the day of week as a number from 0 (Sunday) to 6 (Saturday)
{% now "w" %} {# 1 #} to {# 6 #}
Returns the ISO-8601 week number of year (uses the POSIX module), weeks start on monday.
{% now "w" %} {# 1 #} to {# 53 #}
Returns the year in two digits (with leading zeros)
{% now "y" %} {# 08 #}
Returns the year in four (or more) digits (with leading zeros)
{% now "Y" %} {# 2008 #}
Returns the day of the year without leading zeros
{% now "z" %} {# 0 #} to {# 365 #}
Returns the difference of the current timezone to GMT in seconds.
{% now "Z" %} {# -43200 #} to {# 43200 #}
If you find any, please inform me about them.
http://www.djangoproject.com, Dotiac::DTL
Dotiac::DTL was built according to http://docs.djangoproject.com/en/dev/ref/templates/builtins/.
Marc-Sebastian Lucksch
perl@marc-s.de
To install Dotiac::DTL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dotiac::DTL
CPAN shell
perl -MCPAN -e shell install Dotiac::DTL
For more information on module installation, please visit the detailed CPAN module installation guide.