0

So I have a date in the format dd/mm/yyyy, a time in the format hh:mm:ss AM/PM, and an offset in the format +/-hhmm. These come in a list of these days/time/offset. How can I convert this date and time into a UTC time stamp. For formatting the resulting UTC, I’m assuming I can use string formatting.

martineau
  • 119,623
  • 25
  • 170
  • 301
M.K
  • 27
  • 6
  • Does this answer your question? [Convert a python UTC datetime to a local datetime using only python standard library?](https://stackoverflow.com/questions/4563272/convert-a-python-utc-datetime-to-a-local-datetime-using-only-python-standard-lib) – accdias May 14 '21 at 18:15
  • You will need to first use the [`strptime()`](https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime) method to parse the data and time strings into a `datetime`, which can changed to that UTC timezone. – martineau May 14 '21 at 18:58
  • Glad to hear you were able to decipher my (somewhat garbled at the end) comment. `;¬)` – martineau May 15 '21 at 07:43

0 Answers0