
FUNCTION anytim2dir, time

;+
; NAME
;
;    ANYTIM2DIR
;
; EXPLANATION
;
;    Takes a time in any format accepted by the ANYTIM routines and
;    converts it to a string giving a directory structure based on
;    year, month and day.
;
; INPUTS
;
;    TIME   A time in any format given by the ANYTIM suite of
;           routines. 
;
; OUTPUTS
;
;    A string of the form YYYY/MM/DD where YYYY is the year, MM is the
;    month and DD is the day. E.g., '2010/06/26' for 26-Jun-2010.
;
; EXAMPLE
;
;    IDL> print,anytim2dir('26-Jun-2010 00:00')
;      2010/06/26
;
; CALLS
;
;    ANYTIM2UTC()
;
; HISTORY
;
;    Ver.1, 30-Aug-2012, Peter Young
;    Ver.2, 5-Sep-2012, Peter Young
;       switched to using anytim2utc
;-

extime=anytim2utc(time,/ex)

yy=trim(extime.year)
mm=strpad(trim(extime.month),2,fill='0')
dd=strpad(trim(extime.day),2,fill='0')

dir=yy+'/'+mm+'/'+dd

return,dir

END
