Datetime- time date module
Import datetime
Example 1: convert the log format of nginx to an easy-to-understand format
Time = '10/Aug/2016:03:20:09 + 0800'
A = datetime.datetime.strptime (time,'%d/%b/%Y:%H:%M:%S% z')
A.strftime ('% Y% m% d% H% m')
Import datetime
Example 1: convert the log format of nginx to an easy-to-understand format
Time = '10/Aug/2016:03:20:09 + 0800'
A = datetime.datetime.strptime (time,'%d/%b/%Y:%H:%M:%S% z')
A.strftime ('% Y% m% d% H% m')