-
Notifications
You must be signed in to change notification settings - Fork 0
/
TimeExchanger-v0.2-Original.py
16 lines (15 loc) · 1.17 KB
/
TimeExchanger-v0.2-Original.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import time
import UTCExcTab_OrigintoUTC
import UTCExcTab_UTCtoTarget
Origintimezone = input('Please enter the Origin Timezone') # Get "Origin Time's Timezone".
Origintime = input('Please enter the Origin Time') # Get "Origin Time".
OrigintimeTS = time.mktime(time.strptime(Origintime, "%Y-%m-%d %H:%M:%S")) # Turn "Origin Time" into timestamp.
OrigintimezonetoUTC = float(UTCExcTab_OrigintoUTC.OrigintoUTC(Origintimezone)) # Get the time difference between "Origin Time's Timezone" and UTC.
print(OrigintimezonetoUTC)
Targettimezone = input('Please enter the Target Timezone') # Get "Target Time's Timezone".
UTCtoTargettimezone = float(UTCExcTab_UTCtoTarget.UTCtoTarget(Targettimezone)) # Get the time difference between UTC and "Target Time's Timezone".
print(UTCtoTargettimezone)
DiffOriginnTarget = OrigintimezonetoUTC + UTCtoTargettimezone # Calc the time difference between "Origin Time's Timezone" and "Target Time's Timezone"
TargettimeTS = OrigintimeTS + DiffOriginnTarget # Calc "Targettime"'s timestamp, based on "DiffOriginTarget".
Targettime = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(TargettimeTS)) # Turn "TargettimeTS" into "Target Time"
print(Targettime)