;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; ; create a nice and readable format to print a date ; ; @categories calendar, string ; ; @param yyyymmdd {in}{required} the date in the format yyyymmdd ; ; @file_comments keyword parameters of string function to specify the format of the month (the C format) can be used ; ; @returns a string containing the date in a easy readable format ; ; @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. ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ FUNCTION date2string, yyyymmdd, _EXTRA = ex ; 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