;+
; parse_atime parses a time in any of the allowed formats and returns 
; year, month, day, hour, minutes, and/or seconds depending on
; which keyword parameters are passed.  If the keyword STRING is set, 
; the values are returned as strings, otherwise as numbers.
;
; Kim Tolbert
; 3/5/92
;
; Mod 1/11/94 by AKT to allow any kind of time as input (previously required
; an ASCII time), and call anytim instead of atime.
;-
pro parse_atime, time, year=year, month=month, day=day, hour=hour, min=min, $
    sec=sec, string=string, error=error
;
at = anytim(time, /hxrbs, error=error)
if error then goto,getout
year = strmid (at, 0, 2)
month = strmid (at, 3, 2)
day = strmid (at, 6, 2)
hour = strmid (at, 10, 2)
min = strmid (at, 13, 2)
sec = strmid (at, 16, 6)
;
;if user asked for strings, return.  Otherwise convert to numbers.
if keyword_set(string) then goto, getout
year = year * 1
month = month * 1
day = day * 1
hour = hour * 1
min = min * 1
sec = sec * 1.
;
getout:
return&end
