IODA Bundle
ioda_conv_util.py
Go to the documentation of this file.
1 # This function takes two integers like date=20180415 time=61532 and converts them to a
2 # ISO 8601 standard date/time string like "2018-04-15T06:15:32Z"
3 
4 
5 def IntDateTimeToString(date, time):
6  # Make sure passed values are int's since we're counting on integer division
7  date = int(date)
8  time = int(time)
9  # Define consts to prevent new int objects being created every time we use these numbers
10  TEN_THOW = 10000
11  HUNDRED = 100
12 
13  year = date // TEN_THOW
14  date = date - year * TEN_THOW
15  month = date // HUNDRED
16  day = date - month * HUNDRED
17 
18  hour = time // TEN_THOW
19  time = time - hour * TEN_THOW
20  minute = time // HUNDRED
21  second = time - minute * HUNDRED
22 
23  return "%d-%02d-%02dT%02d:%02d:%02dZ" % (year, month, day, hour, minute, second)
def IntDateTimeToString(date, time)