Reference from: http://www.cnblogs.com/rollenholt/archive/2012/04/11/2441699.html
format string
datetime, date, and time all provide the strftime () method, which receives a format string that outputs a string representation of the DateTime.
The table below is drawn from the Python manual, and I have a simple translation.
Format character meaning
%a Week's shorthand. As Wednesday for web
%a week's full write. As in Wednesday for Wednesday
Abbreviated%B month. If April is Apr
Full write of%b month. As in April for April
%c: string representation of DateTime. (Example: 04/07/10 10:43:39)
%d: The number of days in the month (the day of the week)
%f: microseconds (range [0,999999])
%H: Hours (24-hour, [0, 23])
%I: Hours (12-hour, [0, 11])
%j: Number of days in the year [001,366] (the day of the current year)
%m: Month ([01,12])
%M: Minutes ([00,59])
%p:am or PM
%s: seconds (range = [00,61], why not [00, 59], refer to Python manual ~_~)
%u: Week in the Year of the Week of the year), Sunday as the first day of the week
%w: Today in this week's days, the range is [0, 6],6 represents Sunday
%W: Week of the Year (the Week of the year), Monday as the first day of the week
%x: Date string (for example: 04/07/10)
%x: Time string (for example: 10:43:39)
%y:2 the year represented by a number
%y:4 the year represented by a number
%z: Interval with UTC time (if local time, returns an empty string)
%Z: Time zone name (if local time, returns an empty string)
Percent:%
One of the ways to output a specified month and day under Python