Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Datetime- time date module

Shulou Source: shulou.com Published: 2022-06-01 04:11:39 10月06日 Update

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

Tags: Format log easy to understand date time module Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi NVidia Docker MariaDB vpn