Apr-08-2020, 01:29 PM
I am getting a date like '20200402130324.9500+0530' . How can I convert this to python datatime object ?
datetime object
|
Apr-08-2020, 01:29 PM
I am getting a date like '20200402130324.9500+0530' . How can I convert this to python datatime object ?
Use datetime.datetime.strptime and look for the strptime-behavior.
There is everything what you need. The +0530 is the timezone offset. +5 Hours, +30 minutes. Let me guess: IST Indian Standard Time If you need something to handle timezones, look for pendulum.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians! |
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Review my code: convert a HTTP date header to a datetime object | stevendaprano | 1 | 4,193 |
Dec-17-2022, 12:24 AM Last Post: snippsat |
|
TypeError: unsupported operand type(s) for -: 'datetime.datetime' and 'str' | findbikash | 2 | 11,607 |
Sep-18-2019, 08:32 AM Last Post: buran |
|
Convert from datetime to time.struct_time object | chris0147 | 0 | 5,420 |
Mar-11-2018, 12:01 AM Last Post: chris0147 |
|
Convert String to Datetime Object | tkj80 | 2 | 35,629 |
Apr-20-2017, 08:45 AM Last Post: volcano63 |