Python 基礎(chǔ)教程
Python time strptime() 函數(shù)根據(jù)指定的格式把一個時間字符串解析為時間元組。
strptime()方法語法:
time.strptime(string[, format])
返回struct_time對象。
python中時間日期格式化符號:
以下實例展示了 strptime() 函數(shù)的使用方法:
以上實例輸出結(jié)果為:
返回的元組: time.struct_time(tm_year=2000, tm_mon=11, tm_mday=30, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=335, tm_isdst=-1)其他擴展