0

I'm trying

date_st = '2020-09-30 23:45:27+0000'
daate_ob= datetime.strptime(date_st,"%Y-%m-%d %H:%M:%S.%f%z" )

but it returned ValueError: time data '2020-09-30 23:4527+0000' does not match format '%Y-%m-%d %H:%M:%S.%f%z

Nicolas Rondon
  • 228
  • 2
  • 10

1 Answers1

2

From the format of your date you should use this:

date_st = '2020-09-30 23:45:27+0000'
daate_ob= datetime.strptime(date_st,"%Y-%m-%d %H:%M:%S%z" )
jimakr
  • 574
  • 3
  • 7