source: trunk/SRC/Calendar/date2string.pro @ 97

Last change on this file since 97 was 97, checked in by pinsard, 18 years ago

start to modify headers of Obsolete *.pro files for better idldoc output

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments create a nice and readable format to print a date
7;
8; @categories calendar, string
9;
10; @param yyyymmdd {in}{required} the date in the format yyyymmdd
11;
12; @file_comments keyword parameters of string function to specify the format of the month (the C format) can be used
13;
14; @returns a string containing the date in a easy readable format
15;
16; @examples
17;
18;    IDL> print, date2string(19900123)
19;    Jan 23, 1990
20;    IDL> print, date2string(19900123, format = '(C(CMOA))')
21;    JAN 23, 1990
22;
23; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)
24; Creation ???
25; update/review June 2005 Sebastien Masson.
26;-
27;------------------------------------------------------------
28;------------------------------------------------------------
29;------------------------------------------------------------
30FUNCTION date2string, yyyymmdd, _EXTRA = ex
31;
32   sday = strtrim(long(yyyymmdd) MOD 100, 1)
33   smonth = strtrim((long(yyyymmdd)/100) MOD 100, 2)
34   syear = strtrim(long(yyyymmdd)/10000, 2)
35   res = string(format = '(C(CMoa))', 31*(fix(smonth)-1), _EXTRA = ex) $
36         + ' ' + sday + ', ' + syear
37   return, res
38end
Note: See TracBrowser for help on using the repository browser.