os_date_string [function]
os_date_string( string fmt, int time = os_time() )
returns the date/time string in the format fmt
, optionally for a different time time
- the following item specifiers are supported (*-local-specific):
- %a: abbreviated weekday name *
- %A: full weekday name *
- %b: abbreviated month name *
- %B: full month name *
- %c: full date/time *
- %x: full date *
- %X: full time *
- %Z: timezone name/abbreviation (could be an empty string) *
- %U: week number with first Sunday as the first day of week one *
- %W: week number with first Monday as the first day of week one *
- %C: year/100, as integer
- %d: zero-padded day of the month (01-31)
- %e: space-padded day of the month ( 1-31)
- %F: date, shortcut of "%Y-%m-%d"
- %H: hour in 24h format (00-23)
- %I: hour in 12h format (01-12)
- %j: day of the year (001-366)
- %m: month number (01-12)
- %M: minute (00-59)
- %p: AM or PM
- %R: hour/minute time, shortcut to %H:%M
- %s: second (00-61)
- %T: time, shortcut to %H:%M:%S
- %u: weekday with Sunday as 0
- %w: weekday with Monday as 1
- %y: 2-digit year (00-99)
- %Y: year
- %f: file-safe full time, shortcut to %Y-%m-%d_%H-%M-%S
- %t: the UNIX timestamp
- %%: prints "%"
- %<any other>: prints both characters