function url_query2time, query_str, _extra=_extra, nodef=nodef ; ;+ ; Name: url_query2time ; ; Purpose: convert WWW FORM-POST queries to standard format ; ; Calling Sequence: ; time=url_query2time(/type) ; t ; ; Calling Examples: ; starttime=url_query2time(/start) ; query tags start_xxx ; stoptime =url_query2time(/stop) ; query tags stop_xxx ; reftime =url_query2time(/ref) ; query tags ref_xxx ; ; if not data_chk(_extra,/struct) then begin message,/info,"Must supply a keyword..." return,query_str endif if keyword_set(nodef) then deftime=strarr(6) else begin ut=str2arr(strcompress(strtrim(ut_time(),2)),' ') deftime=[str2arr(ut(0),'-'), str2arr(ut(1),':')] endelse parts=strupcase(str2arr('day,month,year,hour,min,sec')) np=n_elements(parts) outtime='' piece='' delims=['','-','-',' ',':',':',''] pre=(tag_names(_extra))(0) for i=0,np-1 do begin ss=tag_index(query_str,pre+'_'+parts(i)) if ss ne -1 then piece=query_str.(ss) else piece=deftime(i) outtime=([outtime, outtime + delims(i) + piece])(piece ne '') endfor return, outtime end