date= dateutil.parser.parse('20150327T034556Z')
returns:
2015-03-27 03:45:56+00:00
How to get the date part without the time part: (2015-03-27)
There is a date method for datetime objects.
>>> date = dateutil.parser.parse('20150327T034556Z')
>>> date
datetime.datetime(2015, 3, 27, 3, 45, 56, tzinfo=tzutc())
>>> date.date()
datetime.date(2015, 3, 27)
See https://docs.python.org/2/library/datetime.html.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With