;+
; NAME:
;     SYSDOY
; PURPOSE:
;     Simple function to extract the day of year from the system time
; CATEGORY:
;     OVRO APC UTILITY
; CALLING SEQUENCE:
;     doy = sysdoy([stime])
; INPUTS:
; OPTIONAL (KEYWORD) INPUT PARAMETERS:
;     stime   optional string as returned from the systime() command.
;               If omitted, systime() is called within the routine.
; ROUTINES CALLED:
;     dayofyr
; OUTPUTS:
;     doy     the day of year
; COMMENTS:
; SIDE EFFECTS:
; RESTRICTIONS:
; MODIFICATION HISTORY:
;     Written 06-Aug-1998 by Dale E. Gary
;-

function sysdoy,stime

   if (n_elements(stime) eq 0) then stime = systime()

return,dayofyr(strmid(stime,20,4),strmid(stime,4,3),strmid(stime,8,2))
end