Name
strftime() — Decode time string into any format
Common Usage
strftime(format,timestring,modifier1,modifier2, ... )
Description
The strftime() function returns a formatted string
by taking a
(with modifiers) and formating it according to
timestring
, a format
printf() style
format specification. If any of the parameters are in an
incorrect or illegal format, a NULL is returned.
The
string can contain any of the following
markers:format
%d— day of the month (), 01-31DD%f— seconds with fractional part (), 00-59 plus decimal portionSS.sss%H— hour (), 00-23HH%j— day of the year (), 001-366NNN%J— Julian Day number ()DDDDDDD.ddddddd%m— month (), 01-12MM%M— minute (), 00-59MM%s— seconds since 1970-01-01 (Unix epoch)%S— seconds (), 00-59SS%w— day of the week (), starting with Sunday as 0N%W— week of the year (), 00-53WW%Y— year ()YYYY%%— a literal%
The
value can be in any of these formats:timestring
YYYY-MM-DDYYYY-MM-DDHH:MMYYYY-MM-DDHH:MM:SSYYYY-MM-DDHH:MM:SS.sssYYYY-MM-DDTHH:MMYYYY-MM-DDTHH:MM:SSYYYY-MM-DDTHH:MM:SS.sssHH:MMHH:MM:SSHH:MM:SS.sssnowDDDDDDDDDDDDDD.ddddddd
All hour values use a 24-hour clock.
Any value that is not given will be implied. Any implied hour,
minute, second, or subsecond is zero. Any implied month or day
of month is 1. Any implied year is 2000. The full date and time
formats allow either a space or a literal uppercase T between the date and time. The last two values (a single, large integer ...