0

I have list that contains Indonesia datetime like Januari, Februari, Maret, April Mei, Juni, Juli, Agustus, September, Oktober, November, Desember

Suppose that the string in list like 16 Agustus 2021, 10:37 and I expected it could convert to be 2021-08-16 10:37:00

Is it possible If using locale library? How to convert it?

lockey
  • 51
  • 6
  • 1
    Following the solution, you may wish to invoke `locale.setlocale(locale.LC_TIME, "id_ID")` and then try `print(datetime.datetime.strptime('16 Agustus 2021, 10:37', '%d %B %Y, %H:%M'))`; naturally, your system will need to have that locale be installed and available for use. – metatoaster Aug 16 '21 at 04:09

0 Answers0