Search code examples
perltemplate-toolkit

Template Toolkit week number and day


I want to display the week number and the day with the date plugin in Template-toolkit. The output for today would be something like:

36 Monday

I got the week number with the following code:

[% USE date(format = '%W' ) %]
[% date.format %]

Still trying to figure out how to get the weekday.


Solution

  • From http://template-toolkit.org/docs/modules/Template/Plugin/Date.html

    The Date plugin provides an easy way to generate formatted time and date strings by delegating to the POSIX strftime() routine.

    From http://perldoc.perl.org/POSIX.html#strftime

    Consult your system's strftime() manpage for details about these and the other arguments.

    From http://linux.die.net/man/3/strftime

    %A The full weekday name according to the current locale.