function  tim2dow,times,abbreviated=abbreviated
;+
;   Name: tim2dow
;
;   Purpose: convert from any yohkoh time to day of week
;
;   Calling Sequence
;      dows=tim2dow(times [,/abbreviate])
;
;   History:
;      10-apr-1995 (SLF) - I am sure this has been done before...
;-
if n_elements(times) eq 0 then times=!stime

dow=['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday']

otimes = dow((gt_day(times) - gt_day('1-jan-79')) mod 7)	 ; 1-1-79 was Monday

if keyword_set(abbreviated) then otimes=strmid(otimes,0,3)

return, otimes

end
