I have a date string in the format of 3/29/2010. Can someone tell me how to convert it to GMT time?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
This very suspiciously appears that you are trying to correct something for daylight savings time, which is not really something you should be doing manually.
You should review the datetime documentation, and specifically the portions related to using time zones.
could be changed to: timeH1 = (timeH + 5) % 24
and you also need to check the other case and subtract 24 which you aren't doing now