Latest web development tutorials

Python 練習實例95

Python 100例 Python 100例

題目:字符串日期轉換為易讀的日期格式。

程序分析:無。

程序源代碼:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

from dateutil import parser
dt = parser.parse("Aug 28 2015 12:00AM")
print dt

以上實例輸出結果為:

2015-08-28 00:00:00

Python 100例 Python 100例