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