function mk_ftym,filz,ls,nosec=nosec

;+
; NAME
;	mk_ftym
; CALLING SEQUENCE
;	ftym = mk_ftym(filz,ls)
; PURPOSE
;	To convert std YLA file name, e.g.,
;	/disk/hl3/ylegacy/sxtmov29/1991/09/13/sx2m_19910913_214924_121.fts
;	to array of times in CCSDS time format.
; INPUT
;	filz, string array of file names.
;	ls, the number of characters to skip to get to the 
;	   first character of the year.  For the above case ls=43.
;	For, /yla/xdamov30a/1991/09/13/sx2m_19910913_214924_121.xda
;	   then ls should be set to 31.
; OPTIONAL KEYWORD INPUT
;	/nosec, for SSC file names without seconds in the name.
; OUTPUT
;	String array of times in CCSDS time format.
; OUTPUT TO SCREEN
;	print,ftym(0), e.g., 1991-09-13T21:49:24
; HISTORY
;	 8-Apr_2010 LWA
;	14-Apr-2010 LWA  Changed ls reference.
;	20-Jul-2010 LWA  Added info to header.
;	17-Dec-2010 LWA  Added keyword nosec.
;-

nosec=keyword_set(nosec)

if not nosec then begin
   ftym=strmid(filz,0+ls,4)+'-'+strmid(filz,4+ls,2)+'-'+$
   strmid(filz,6+ls,2)+'T'+strmid(filz,9+ls,2)+':'+$
   strmid(filz,11+ls,2)+':'+strmid(filz,13+ls,2)
endif else begin
   ftym=strmid(filz,0+ls,4)+'-'+strmid(filz,4+ls,2)+'-'+$
   strmid(filz,6+ls,2)+'T'+strmid(filz,9+ls,2)+':'+$
   strmid(filz,11+ls,2)
endelse

print,ftym(0)
return,ftym
end
