;+ ; NAME: ; MIN2DATE ; ; PURPOSE: ; This procedure converts time from minutes (pass 1-1-80) to year, month, ; day, hour and minute. ; ; CALLING SEQUENCE: ; GETDATE, MINUTES, YR, MO, DY, HR, MN ; ; INPUTS: ; MINUTES (Long) Time in minutes (pass 1-1-80). ; ; OUTPUTS: ; YR (Integer) Last two digits of year [80, 99]. ; MO (Integer) 2 digits abbreviation of month, [1, 12]. ; DY (Integer) Day of month, [1, 31]. ; HR (Integer) Hour of the day, [0, 23]. ; MN (Integer) Minute of the hour, [0, 59]. ; ; KEYWORD PARAMETERS: ; ; RESTRICTIONS: ;- ;============================================================================= PRO Min2Date, minutes, yr, mo, dy, hr, mn year = LONARR(20) year(*) = [527040, 525600, 525600, 525600, 527040, 525600, 525600, 525600, $ 527040, 525600, 525600, 525600, 527040, 525600, 525600, 525600, $ 527040, 525600, 525600, 525600] mon_of_yr = LONARR(12) mon_of_yr(*) = [44640, 40320, 44640, 43200, 44640, 43200, $ 44640, 44640, 43200, 44640, 43200, 44640] mon_of_leapyr = LONARR(12) mon_of_leapyr(*) = [44640, 41760, 44640, 43200, 44640, 43200, $ 44640, 44640, 43200, 44640, 43200, 44640] min_in_day = 1440 min_in_hr = 60 startyr = 80 startmon = 1 startday = 1 t = LONG(minutes) i = 0 WHILE t GE year(i) DO BEGIN t = t - year(i) i = i + 1 ENDWHILE yr = startyr + i if (yr MOD 4) EQ 0 then $ month = mon_of_leapyr $ else $ month = mon_of_yr i = 0 WHILE t GE month(i) DO BEGIN t = t - month(i) i = i + 1 ENDWHILE mo = startmon + i dy = t / min_in_day t = t - LONG(dy) * min_in_day dy = startday + dy hr = t / min_in_hr mn = t - hr * min_in_hr END