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

Last change on this file since 232 was 231, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1009 bytes
Line 
1;+
2;
3; @file_comments
4; create a nice and readable format to print a date
5;
6; @categories
7; Calendar, String
8;
9; @param yyyymmdd {in}{required} {type=scalor or array}
10; the date in the format yyyymmdd.
11;
12; @keyword _EXTRA
13; Used to pass keywords
14;
15; @returns
16; a string containing the date in a easy readable format with the
17; same number of elements than yyyymmdd.
18;
19; @examples
20;
21; IDL> print, date2string(19900123)
22;    Jan 23, 1990
23; IDL> print, date2string(19900123, format = '(C(CMOA))')
24;    JAN 23, 1990
25;
26; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)
27; Creation ???
28; update/review June 2005 Sebastien Masson.
29;
30; @version
31; $Id$
32;
33;-
34;
35FUNCTION date2string, yyyymmdd, _EXTRA = ex
36;
37  compile_opt idl2, strictarrsubs
38;
39   sday = strtrim(long(yyyymmdd) MOD 100, 1)
40   smonth = strtrim((long(yyyymmdd)/100) MOD 100, 2)
41   syear = strtrim(long(yyyymmdd)/10000, 2)
42   res = string(format = '(C(CMoa))', 31*(fix(smonth)-1), _EXTRA = ex) $
43         + ' ' + sday + ', ' + syear
44   return, res
45end
Note: See TracBrowser for help on using the repository browser.