645 | | Uses the same format as PHP's ``date()`` function (http://php.net/date) |
646 | | with some custom extensions. |
647 | | |
648 | | Available format strings: |
649 | | |
650 | | ================ ======================================== ===================== |
651 | | Format character Description Example output |
652 | | ================ ======================================== ===================== |
653 | | a ``'a.m.'`` or ``'p.m.'`` (Note that ``'a.m.'`` |
654 | | this is slightly different than PHP's |
655 | | output, because this includes periods |
656 | | to match Associated Press style.) |
657 | | A ``'AM'`` or ``'PM'``. ``'AM'`` |
658 | | b Month, textual, 3 letters, lowercase. ``'jan'`` |
659 | | B Not implemented. |
660 | | c ISO 8601 Format. ``2008-01-02T10:30:00.000123`` |
661 | | d Day of the month, 2 digits with ``'01'`` to ``'31'`` |
662 | | leading zeros. |
663 | | D Day of the week, textual, 3 letters. ``'Fri'`` |
664 | | f Time, in 12-hour hours and minutes, ``'1'``, ``'1:30'`` |
665 | | with minutes left off if they're zero. |
666 | | Proprietary extension. |
667 | | F Month, textual, long. ``'January'`` |
668 | | g Hour, 12-hour format without leading ``'1'`` to ``'12'`` |
669 | | zeros. |
670 | | G Hour, 24-hour format without leading ``'0'`` to ``'23'`` |
671 | | zeros. |
672 | | h Hour, 12-hour format. ``'01'`` to ``'12'`` |
673 | | H Hour, 24-hour format. ``'00'`` to ``'23'`` |
674 | | i Minutes. ``'00'`` to ``'59'`` |
675 | | I Not implemented. |
676 | | j Day of the month without leading ``'1'`` to ``'31'`` |
677 | | zeros. |
678 | | l Day of the week, textual, long. ``'Friday'`` |
679 | | L Boolean for whether it's a leap year. ``True`` or ``False`` |
680 | | m Month, 2 digits with leading zeros. ``'01'`` to ``'12'`` |
681 | | M Month, textual, 3 letters. ``'Jan'`` |
682 | | n Month without leading zeros. ``'1'`` to ``'12'`` |
683 | | N Month abbreviation in Associated Press ``'Jan.'``, ``'Feb.'``, ``'March'``, ``'May'`` |
684 | | style. Proprietary extension. |
685 | | O Difference to Greenwich time in hours. ``'+0200'`` |
686 | | P Time, in 12-hour hours, minutes and ``'1 a.m.'``, ``'1:30 p.m.'``, ``'midnight'``, ``'noon'``, ``'12:30 p.m.'`` |
687 | | 'a.m.'/'p.m.', with minutes left off |
688 | | if they're zero and the special-case |
689 | | strings 'midnight' and 'noon' if |
690 | | appropriate. Proprietary extension. |
691 | | r RFC 2822 formatted date. ``'Thu, 21 Dec 2000 16:01:07 +0200'`` |
692 | | s Seconds, 2 digits with leading zeros. ``'00'`` to ``'59'`` |
693 | | S English ordinal suffix for day of the ``'st'``, ``'nd'``, ``'rd'`` or ``'th'`` |
694 | | month, 2 characters. |
695 | | t Number of days in the given month. ``28`` to ``31`` |
696 | | T Time zone of this machine. ``'EST'``, ``'MDT'`` |
697 | | u Microseconds. ``0`` to ``999999`` |
698 | | U Seconds since the Unix Epoch |
699 | | (January 1 1970 00:00:00 UTC). |
700 | | w Day of the week, digits without ``'0'`` (Sunday) to ``'6'`` (Saturday) |
701 | | leading zeros. |
702 | | W ISO-8601 week number of year, with ``1``, ``53`` |
703 | | weeks starting on Monday. |
704 | | y Year, 2 digits. ``'99'`` |
705 | | Y Year, 4 digits. ``'1999'`` |
706 | | z Day of the year. ``0`` to ``365`` |
707 | | Z Time zone offset in seconds. The ``-43200`` to ``43200`` |
708 | | offset for timezones west of UTC is |
709 | | always negative, and for those east of |
710 | | UTC is always positive. |
711 | | ================ ======================================== ===================== |
| 645 | Given format can be one of the predefined ones ``DATE_FORMAT``, |
| 646 | ``DATETIME_FORMAT``, ``SHORT_DATE_FORMAT`` or ``SHORT_DATETIME_FORMAT``, |
| 647 | or a custom format, same as the :tfilter:`date` filter. Note that predefined formats |
| 648 | may vary depending on the current locale. |
| 1074 | Uses the same format as PHP's ``date()`` function (http://php.net/date) |
| 1075 | with some custom extensions. |
| 1076 | |
| 1077 | Available format strings: |
| 1078 | |
| 1079 | ================ ======================================== ===================== |
| 1080 | Format character Description Example output |
| 1081 | ================ ======================================== ===================== |
| 1082 | a ``'a.m.'`` or ``'p.m.'`` (Note that ``'a.m.'`` |
| 1083 | this is slightly different than PHP's |
| 1084 | output, because this includes periods |
| 1085 | to match Associated Press style.) |
| 1086 | A ``'AM'`` or ``'PM'``. ``'AM'`` |
| 1087 | b Month, textual, 3 letters, lowercase. ``'jan'`` |
| 1088 | B Not implemented. |
| 1089 | c ISO 8601 Format. ``2008-01-02T10:30:00.000123`` |
| 1090 | d Day of the month, 2 digits with ``'01'`` to ``'31'`` |
| 1091 | leading zeros. |
| 1092 | D Day of the week, textual, 3 letters. ``'Fri'`` |
| 1093 | f Time, in 12-hour hours and minutes, ``'1'``, ``'1:30'`` |
| 1094 | with minutes left off if they're zero. |
| 1095 | Proprietary extension. |
| 1096 | F Month, textual, long. ``'January'`` |
| 1097 | g Hour, 12-hour format without leading ``'1'`` to ``'12'`` |
| 1098 | zeros. |
| 1099 | G Hour, 24-hour format without leading ``'0'`` to ``'23'`` |
| 1100 | zeros. |
| 1101 | h Hour, 12-hour format. ``'01'`` to ``'12'`` |
| 1102 | H Hour, 24-hour format. ``'00'`` to ``'23'`` |
| 1103 | i Minutes. ``'00'`` to ``'59'`` |
| 1104 | I Not implemented. |
| 1105 | j Day of the month without leading ``'1'`` to ``'31'`` |
| 1106 | zeros. |
| 1107 | l Day of the week, textual, long. ``'Friday'`` |
| 1108 | L Boolean for whether it's a leap year. ``True`` or ``False`` |
| 1109 | m Month, 2 digits with leading zeros. ``'01'`` to ``'12'`` |
| 1110 | M Month, textual, 3 letters. ``'Jan'`` |
| 1111 | n Month without leading zeros. ``'1'`` to ``'12'`` |
| 1112 | N Month abbreviation in Associated Press ``'Jan.'``, ``'Feb.'``, ``'March'``, ``'May'`` |
| 1113 | style. Proprietary extension. |
| 1114 | O Difference to Greenwich time in hours. ``'+0200'`` |
| 1115 | P Time, in 12-hour hours, minutes and ``'1 a.m.'``, ``'1:30 p.m.'``, ``'midnight'``, ``'noon'``, ``'12:30 p.m.'`` |
| 1116 | 'a.m.'/'p.m.', with minutes left off |
| 1117 | if they're zero and the special-case |
| 1118 | strings 'midnight' and 'noon' if |
| 1119 | appropriate. Proprietary extension. |
| 1120 | r RFC 2822 formatted date. ``'Thu, 21 Dec 2000 16:01:07 +0200'`` |
| 1121 | s Seconds, 2 digits with leading zeros. ``'00'`` to ``'59'`` |
| 1122 | S English ordinal suffix for day of the ``'st'``, ``'nd'``, ``'rd'`` or ``'th'`` |
| 1123 | month, 2 characters. |
| 1124 | t Number of days in the given month. ``28`` to ``31`` |
| 1125 | T Time zone of this machine. ``'EST'``, ``'MDT'`` |
| 1126 | u Microseconds. ``0`` to ``999999`` |
| 1127 | U Seconds since the Unix Epoch |
| 1128 | (January 1 1970 00:00:00 UTC). |
| 1129 | w Day of the week, digits without ``'0'`` (Sunday) to ``'6'`` (Saturday) |
| 1130 | leading zeros. |
| 1131 | W ISO-8601 week number of year, with ``1``, ``53`` |
| 1132 | weeks starting on Monday. |
| 1133 | y Year, 2 digits. ``'99'`` |
| 1134 | Y Year, 4 digits. ``'1999'`` |
| 1135 | z Day of the year. ``0`` to ``365`` |
| 1136 | Z Time zone offset in seconds. The ``-43200`` to ``43200`` |
| 1137 | offset for timezones west of UTC is |
| 1138 | always negative, and for those east of |
| 1139 | UTC is always positive. |
| 1140 | ================ ======================================== ===================== |
| 1141 | |