|
Help
CodingForums Partners
This is a
![]() |
|
| CODE | PURPOSE OF CODE | Sample output |
| %a | abbreviated weekday name | Sun |
| %A | full weekday name | Sunday |
| %b | abbreviated month name | Jan |
| %B | full month name | January |
| %c | locale's appropriate date and time | Sun Dec 28 04:45:57 2005 |
| %d | day of month - 01 to 31 | 25 |
| %D | date as %m/%d/%y | 12/25/05 |
| %e | day of month - 1 to 31 | 25 |
| %H | hour - 00 to 23 | 15 |
| %I | hour - 01 to 12 | 03 |
| %j | day of year - 001 to 366 | 361 |
| %m | month of year - 01 to 12 | 12 |
| %M | minute - 00 to 59 | 09 |
| %n | insert a newline character | |
| %p | string containing AM or PM | PM |
| %r | time as %I:%M:%S %p | 06:08:05 PM |
| %R | time as %H:%M | 15:09 |
| %S | second - 00 to 59 | 02 |
| %t | insert a tab character | |
| %T | time as %H:%M:%S | 15:21:07 |
| %U | week number of year (Sunday is the first day of the week) - 00 to 53 | 52 |
| %w | day of week - Sunday=0 | 0 |
| %W | week number of year (Monday is the first day of the week) - 00 to 53 | 51 |
| %x | Country-specific date format | 12/25/05 |
| %X | Country-specific time format | 04:50:29 |
| %y | year within century - 00 to 99 | 05 |
| %Y | year as CCYY (4 digits) | 2005 |
| %Z | timezone name | PST |
Here are a couple more examples:
<!--#config timefmt="%A %d %B, %Y" --> <!--#echo var="DATE_LOCAL" -->
Output: Sunday 11 May, 2008
<!--#config timefmt="%D %r"--> This document last modified: <!--#echo var="LAST_MODIFIED" -->
Output: This document last modified: 03/04/06 03:41:24 AM
So far on this page I've only used the #config command to format time related output. But you can also use this command on file size output:
<!--#config sizefmt="abbrev"--> <!--#fsize file="current.shtml" -->
<!--#config sizefmt="bytes"--> <!--#fsize file="current.shtml" -->
The first code tells the server to display the file size in abbreviated form, rounded to the nearest kilobytes. The second example obviously displays the size in bytes instead.