TimeParser into i64. Generic argument across create_reminder. Some more work on natural inc. splitting off first args and calling the subprocess
This commit is contained in:
13
dp.py
Normal file
13
dp.py
Normal file
@ -0,0 +1,13 @@
|
||||
import dateparser
|
||||
import sys
|
||||
import pytz
|
||||
from datetime import datetime
|
||||
|
||||
dt = dateparser.parse(sys.argv[1], settings={
|
||||
'TIMEZONE': sys.argv[2],
|
||||
'TO_TIMEZONE': sys.argv[3],
|
||||
'RELATIVE_BASE': datetime.now(pytz.timezone(sys.argv[2])).replace(tzinfo=None),
|
||||
'PREFER_DATES_FROM': 'future',
|
||||
})
|
||||
|
||||
print(dt.timestamp() if dt is not None else -1)
|
Reference in New Issue
Block a user