Closed alimo closed 6 years ago
@alimo thanks for reporting it. Could you create a failing test case?
This fails:
date_string = "1363-6-6T12:13:14"
date_format = "%Y-%m-%dT%H:%M:%S"
dt1 = jdatetime.datetime.strptime(date_string, date_format)
dt2 = jdatetime.datetime(1363, 6, 6, 12, 13, 14)
self.assertEqual(dt1, dt2)
I can submit a PR if that's ok with you.
Currently
([%a-zA-Z]{2})
regex is used to find format codes. It detects any two consecutive English characters (including percent sign) which will cause an error if the format contains another English character as separator (Like how javascriptDate
object uses 'T' to separate date from time). This method should be using(%[a-zA-Z])
regex to detect %-char pairs.