Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Python Exercise Example 95

Python Exercise Example 95

Python 100 Examples Python 100 Examples

**Problem:** Convert a string date into an easy-to-read date format.

**Analysis:** None.

Program source code:


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

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

The output of the above example is:


2015-08-28 00:00:00

Python 100 Examples Python 100 Examples