Since I am INSANELY hyped for the Final Fantasy XV Uncovered event, I want you to write me a program to tell me when it is!!!
Your take input in the form of
HH:MM XDT, where
HH is a number in the range
MM is a number between
XDT is a time zone, with
X being one of
E (eastern, UTC-4),
C (central, UTC-5),
P (pacific, UTC-7), or
M (mountain, UTC-6). This is a time assumed to be PM. Valid inputs include:
1:00 EDT (1 PM Eastern Daylight Time) 4:05 MDT (4:05 PM Mountain Daylight Time) 12:23 PDT (12:23 PM Pacific Daylight Time) 1:10 CDT (1:10 PM Central Daylight Time)
The input may be assumed to be valid.
Your program must do the following:
Convert the given time to PDT and output
It is XX:XX PM PDT., where
XX:XXis the converted time. Note that you do not need to handle any case where converting the time would cross the AM/PM boundary.
Print one of the following:
If the converted time is before 6:00 PM PDT, print
X minutes until the pre-show!, replacing
Xwith the number of minutes until 6:00 PM PDT.
If the converted time is after or equal to 6:00 PM PDT and before 7:00 PM PDT, print
Pre-show started X minutes ago; UNCOVERED is starting in Y minutes!, where
Xis the number of minutes that have passed since 6:00 PM PDT, and
Yis the number of minutes until 7:00 PM PDT.
If the converted time is after or equal to 7:00 PM PDT, print
UNCOVERED started X minutes ago!, where
Xis the number of minutes that have passed since 7:00 PM PDT.
Each string printed must be followed by a newline.
This is code golf, so the shortest program wins.