2

I've written a custom date class for a non-Gregorian calendar system.

Is there an easy way to implement strftime and strptime without having to implement all the logic myself?

My class has a day, month and year field, so in principle all I would need to provide the existing strftime and strptime implementations are the names of months and days of the week as strings.

AlfaZulu
  • 921
  • 5
  • 13
  • Well, `strftime` just delegates to the C library function, so it might be impossible – SuperStormer Aug 14 '23 at 22:13
  • Both `strftime` and `strptime` have a [format option](https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes). Is this not sufficient? If so, please describe your requirements in more detail. – ken Aug 15 '23 at 05:13

0 Answers0