datetime.datetime.strptime
has problems with timezone parsing. Have a look at the dateutil
package:
>>> from dateutil import parser
>>> parser.parse("Tue May 08 15:14:45 +0800 2012")
datetime.datetime(2012, 5, 8, 15, 14, 45, tzinfo=tzoffset(None, 28800))
More Related Contents:
- How do I parse an ISO 8601-formatted date?
- How do I translate an ISO 8601 datetime string into a Python datetime object? [duplicate]
- Natural/Relative days in Python
- How to print a date in a regular format?
- Convert UTC datetime string to local datetime
- How to make a timezone aware datetime object in Python?
- Pandas Dataframe line plot display date on xaxis
- Adding days to a date in Python
- How to convert integer timestamp to Python datetime
- How can I parse a time string containing milliseconds in it with python?
- How to convert integer timestamp into a datetime
- How do you convert a time.struct_time object into a datetime object?
- How to round the minute of a datetime object
- In Python, how do you convert seconds since epoch to a `datetime` object?
- How do I create a datetime in Python from milliseconds?
- What’s the best way to find the inverse of datetime.isocalendar()?
- Converting string “Jun 1 2005 1:33PM” into datetime
- pandas to_datetime parsing wrong year
- Python/Pandas convert string to time only
- Convert Pandas Series to DateTime in a DataFrame
- Convert dataframe index to datetime
- How to add/subtract time (hours, minutes, etc.) from a Pandas DataFrame.Index whos objects are of type datetime.time?
- How to get current date and time from GPS unsegment time in python
- How to convert a Date string to a DateTime object?
- Seaborn tsplot does not show datetimes on x axis well
- Group DataFrame in 5-minute intervals
- Convert a column of timestamps into periods in pandas
- Python: Adding hours to pandas timestamp
- how to specify the datetime format in read_csv
- Python generating a list of dates between two dates