| |
strftime
| Format:
strftime( [ format, ] time ) |
Purpose:
Format a time value.
The format parameter must denote a string.
If the format parameter is not given,
it defaults to "%c".
The time parameter must denote an object
containing the broken down time as returned by localtime() or gmtime().
The structure of a broken down time object is described in localtime().
Return Values:
Returns a string that is the result of formatting the time parameter with the
format parameter.
The format string consists of
zero or more conversion specifications and ordinary characters. A
conversion specification consists of a '%' (percent) character followed
by a character that determines the specification's behavior. Ordinary
characters are copied unchanged into the result string. Each
conversion specification is replaced by appropriate characters as
described in the following list.
| conversion | replacement |
| %% | percent character |
| %a | abbreviated weekday name |
| %A | full weekday name |
| %b | abbreviated month name |
| %B | full month name |
| %c | default date and time representation |
| %d | day of month, two digits 01-31 |
| %H | hour, two digits 00-23 |
| %I | hour, two digits 01-12 |
| %j | day of the year, three digits 001-366 |
| %m | month number, two digits 01,12 |
| %M | minute, two digits 00-59 |
| %p | a.m. or p.m. designation of the 12-hour clock |
| %S | second, two digits 00-61. |
| %U | week number of the year (the first Sunday as the
first day of week 1), two digits 00-53 |
| %w | weekday number, 0-6, Sunday is 0 |
| %W | week number of the year (the first Monday as the
first day of week 1), two digits 00-53 |
| %x | default date representation |
| %X | default time representation |
| %y | year within century, two digits 00-2004 |
| %Y | year with century |
| %Z | time zone name or abbreviation, or nothing if time
zone is unknown |
Example:
| input: | resulting output:
|
<? strftime ("%A %b %d %j %H:%M", localtime(caltime()))> | Wednesday Oct 29 302 22:18 |
<? strftime ("%A %b %d %j %H:%M", gmtime(caltime()))> | Wednesday Oct 29 302 22:18 |
|
Note:
Internationalization support is planned for the next major revision of heitml.
|
See Also:
caltime(), difftime(), gmtime(), localtime() mktime(), strptime().
This page was dynamically generated by the
web application development tool RADpage
of H.E.I.
H.E.I. provides support, tools, and services like
Webdesign in Mannheimm,
the HTML/CSS 3D WebGL Animation Library taccgl,
3D Webdesign, and
3D Product Configurator
(3D Produkt Konfigurator in German).
Selected blog articles :
3D Objects on HTML pages,
CSS Transition Visibility, and
CSS Transition Display.
© 1996-2025 H.E.I. All Rights Reserved.
|