I am working on a program which gets a human-friendly input and converts it into a unix time (i.e. seconds since 1970 1st January midnight).
2030y1d4M: Midnight on 1st April 20302030y1d4M5m: 00:05 on 1st April 20306h1d4M: 06:00 on 1st April in the current year
Basically, the user would input some or all of the units in arbitrary order.
I've looked for similar questions and found some external sites to convert units into timedelta. However, none suggested a way to convert it into a datetime object. strptime is too strict and doesn't (seem to) allow for different orders
It doesn't matter whether it converts into a datetime.datetime object and then the unix time, or directly into unix. I might not need the exact code, but I would be glad to be pointed at the right direction.