strftime reference and sandbox

format dates and times in Ruby, Python, C & PHP with strftime

strftime quick reference

Dates

%aThe abbreviated weekday name ("Sun")
%AThe full weekday name ("Sunday")
%bThe abbreviated month name ("Jan")
%BThe full month name ("January")
%dDay of the month (01..31)
%eDay of the month without a leading zero (1..31)
%jDay of the year (001..366)
%mMonth of the year (01..12)
%UWeek number of the current year, starting with the first Sunday as the first day of the first week (00..53)
%WWeek number of the current year, starting with the first Monday as the first day of the first week (00..53)
%wDay of the week (Sunday is 0, 0..6)
%xPreferred representation for the date alone, no time
%yYear without a century (00..99)
%YYear with century

Times

%HHour of the day, 24-hour clock (00..23)
%IHour of the day, 12-hour clock (01..12)
%lHour of the day, 12-hour clock without a leading zero (1..12)
%MMinute of the hour (00..59)
%NFractional seconds digits, default is 9 digits (nanosecond)
%PMeridian indicator ("am" or "pm")
%pMeridian indicator ("AM" or "PM")
%SSecond of the minute (00..60)
%XPreferred representation for the time alone, no date
%ZTime zone name

Misc.

%cThe preferred local date and time representation
%%Literal "%" character