;------------------------------------------------------------ ;+ ; ; @file_comments ; create a nice and readable format to print a date ; ; @categories ; Calendar, String ; ; @param yyyymmdd {in}{required} ; the date in the format yyyymmdd. Can be scalar or array ; ; @keyword _EXTRA ; used to pass your keywords to other procedures, for example ; keyword FORMAT of string function (see example bellow) ; ; @returns ; a string containing the date in a easy readable format with the ; same number of elements than yyyymmdd. ; ; @examples ; ; IDL> print, date2string(19900123) ; Jan 23, 1990 ; IDL> print, date2string(19900123, format = '(C(CMOA))') ; JAN 23, 1990 ; ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) ; Creation ??? ; update/review June 2005 Sebastien Masson. ; ; @version $Id$ ; ;- ;------------------------------------------------------------ FUNCTION date2string, yyyymmdd, _EXTRA = ex ; ; compile_opt idl2, strictarrsubs ; sday = strtrim(long(yyyymmdd) MOD 100, 1) smonth = strtrim((long(yyyymmdd)/100) MOD 100, 2) syear = strtrim(long(yyyymmdd)/10000, 2) res = string(format = '(C(CMoa))', 31*(fix(smonth)-1), _EXTRA = ex) $ + ' ' + sday + ', ' + syear return, res end