datetime - Convert string timestamp (with timezone offset) to local time. . ? python -


I am trying to convert a string timestamp into a proper date time object. The problem I have is that the time zone is offset and whatever I am doing does not seem to work.

Eventually I want to change the string timestamp in the timezone in my machine's timezone to Datam object.

  # string timestamp date = u "Friday, July 16, 2010 07:08:23 -0700"  

The package is easy to parse date / time:

 in  [10]: date = u" Fri, July 16, 2010 07: 08:23 -0700 "in [11]: In Date Piece Imports Pars [12]: Purse (Date) Out [12]: datetime.datetime (2010, 7, 16, 7, 8, 23, tzinfo = tzoffset (any No, at the end, to convert to your local timezone, in  
  [13]: pars (date). Stimazon (YOUR_LOC AL_TIMEZONE)  

code>


Comments