Python script for converting date and time using my favorite thing: regex
Like anything else I shared, it's in perpetual development. You can play with the broken version here.
from Ozone import Ozone
Ozone.ozonize("20.04.2020 16:00 CET GMT")
The insides are held together by duct tape, but if you feed it a string in a format of:
DATE TIME (TIME_END) TIMEZONE_INPUT TIMEZONE_OUTPUT ($FORMAT)
It will convert the date and time, from and to the timezones provided and return a tuple with strings:
DATE TIME TIMEZONE_OUTPUT
And optional:
DATE TIME_END TIMEZONE_OUTPUT
Format is optional, and if nothing is passed default is being used:
dd.mm.yyyy HH:MM (HH:MM) # 20.04.2020 16:20
If you are using dates in different formats, you can pass the custom format at the end using $, and separating every item with a $
Available formats:
-
$mdy
04.20.2020
-
$ymd
2020.04.20
-
$ydm
2020.20.04
-
$Mdy
Apr 20, 2020
-
$12
04:00 PM
-
$24
16:00