Converts a value to a time string.
*About time format
The following formats can be combined. Strings other than the format will be output as is.
--- Basic format ---
%Y Year in four digits (0100-9999)
%#Y Year without leading zeros (100-9999)
%y Last two digits of the year (00-99)
%#y Last two digits of the year without leading zeros (0-99)
%m Month in two digits (01-12)
%#m Month without leading zero (1-12)
%d 2-digit day (01-31)
%#d Day without leading zero (1-31)
%p, %#p Morning/afternoon, AM/PM
%I 2-digit hour in 12-hour format (01-12)
%#I Hour in 12-hour format with no leading zero (1-12)
%H Two-digit 24-hour hour (00-23)
%#H 24-hour hour with no leading zero (0-23)
%M Minute in two digits (00-59)
%#M Minutes without leading zeros (0-59)
%S Second in two digits (00-59)
%#S Second without leading zero (0-59)
%%, %#% One percent sign (%)
--- Slightly more advanced formatting ---
%b, %#b Abbreviated month name (Jan, Feb etc.)
%B, %#B Full name of month (January, February etc.)
%a, %#a Abbreviated name of day of the week (Sun, Mon etc.)
%A, %#A Full name of day of the week (Sunday, Monday etc.)
%w, %#w Day of the week as a single digit (0-6), Sunday being 0
--- Advanced formatting ---
%j Day of the year in three digits (001-366)
%#j Day number of the year without leading zero (1-366)
%U Two-digit week number, with Sunday as the first day of the week (00-51)
%#U The week number, with Sunday as the first day, without leading zeros (0-51)
%W Two-digit week number, with Monday as the first day of the week (00-51)
%#W The week number, with Monday as the first day of the week, without leading zeros (0-51)
%c Same as "%m/%d/%y %H:%M:%S"
%#c "%A, %B %d, %Y Same as %H:%M:%S"
%x Same as "%m/%d/%y"
%#x Same as "%A, %B %d, %Y"
%X, %#X Same as "%H:%M:%S"
%z, %#z, %Z, %#Z The name of the time zone or its abbreviation (no characters are output if the time zone is unknown)
|