Last change
on this file since 326 was
325,
checked in by pinsard, 17 years ago
|
modification of some headers (+some corrections) to prepare usage of the new idldoc
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
1.0 KB
|
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 to <proidl>string</proidl> function |
---|
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 |
---|
27 | ; Sebastien Masson (smasson\@lodyc.jussieu.fr) |
---|
28 | ; Creation ??? |
---|
29 | ; update/review June 2005 Sebastien Masson. |
---|
30 | ; |
---|
31 | ; @version |
---|
32 | ; $Id$ |
---|
33 | ; |
---|
34 | ;- |
---|
35 | FUNCTION 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 |
---|
45 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.