import datetime

例1:把nginx的日志格式转化为易懂的格式

    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')

    wKioL1h8bJrB7rH1AAAZNMDKRQs499.png