C:strftime
lastmod 2023-09-05created 2016-04-125 edits
Format time as string
Syntax
Copies into ptr the content of format, expanding its format specifiers into the corresponding values that represent the time described in timeptr, with a limit of maxsize characters.
Format
| | Abbreviated weekday name. |
| | Full weekday name. |
| | Abbreviated month name. |
| | Full month name. |
| | Date/time in the locale's format. |
| | Century number [00-99]: the year divided by 100 and truncated to an integer. |
| | Day of the month [01-31]. |
| | Date format (same as %m/%d/%y). |
| | Same as %d, except that single digits are preceded by a space [1-31]. |
| | Two-digit year portion of the ISO week date [00,99]. |
| | ISO date format (same as %Y-%m-%d). |
| | Four-digit year portion of the ISO week date. May be negative. |
| | Same as %b. |
| | Hour in 24-hour format [00-23]. |
| | Hour in 12-hour format [01-12]. |
| | Day of the year [001-366]. |
| | Month [01-12]. |
| | Minute [00-59]. |
| | Newline character. |
| | AM or PM string. |
| | Time in the locale's AM/PM format. If the locale time format is not available, the default is the POSIX AM/PM time format (%I:%M:%S %p). |
| | 24-hour format without seconds (same as %H:%M). |
| | Second [00-61]. The range of seconds allows for leap seconds and double leap seconds. |
| | Tab character. |
| | 24-hour format with seconds (same as %H:%M:%S). |
| | Weekday [1,7]. Monday is 1 and Sunday is 7. |
| | Week number of the year [00-53]. Sunday is the first day of the week. |
| | ISO week number of the year [01-53]. Monday is the first day of the week. If the week containing January 1 has four or more days in the new year, it is considered week 1. Otherwise, it is the last week of the previous year, and the next week is week 1 of the new year. |
| | Weekday [0,6]. Sunday is 0. |
| | Week number of the year [00-53]. Monday is the first day of the week. |
| | Date in the locale's format. |
| | Time in the locale's format. |
| | Two-digit year [00,99]. |
| | Four-digit year. May be negative. |
| | UTC offset. The output is a string of the form +HHMM or -HHMM, where + means east of GMT and - means west of GMT. HH is the number of hours from GMT and MM is the number of minutes from GMT. |
| | Time zone name. |
| | % character. |
Commonly used filename-safe format: %Y%m%d-%H%M%S%z (the time part is all uppercase)