You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
289 B
Python
10 lines
289 B
Python
from ctparse import ctparse #Used for parsing time, https://ctparse.readthedocs.io/en/latest/
|
|
from datetime import datetime
|
|
|
|
def parsetime(phrase):
|
|
ts = datetime.now()
|
|
return ctparse(phrase, ts=ts)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print(parsetime('May 5th 2:30 in the afternoon').ref_time6) |