source: trunk/SRC/Obsolete/juldate.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.9 KB
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5; @file_comments you better use date2jul
6; @obsolete
7;
8; @file_comments  gives julian date equivalent of a date in vairmer
9;           ( yymmdd or yyyymmdd ) format
10;           sets month, day and year to the corresp values
11;
12; @categories calendar
13;
14; @param vvdate {in} date de la forme yymmdd ou yyyymmdd
15;
16; @uses common.pro vraidate
17;
18; @returns date en jour julien
19;   l'annee 0 n'existant pas, qd year est nulle on calcule le
20;     jour julien de l'annee -1.
21;   COMPATIBLE AVEC L'AN 2000 !!!: une date de la forme yymmdd est
22;    donvertit sous la forme yyyymmdd a l''aide de vraidate.
23;   Attention, les variables globales year, month day sont attribuees
24;
25; @examples
26; IDL> date = juldate(930124)
27;
28; @history Jerome Vialard  (jv\@lodyc.jussieu.fr)
29; 2/7/98
30;-
31;------------------------------------------------------------
32;------------------------------------------------------------
33;------------------------------------------------------------
34function juldate, vvdate, _EXTRA = ex
35vdate = vvdate
36vdate = vraidate(vdate, _EXTRA = ex)
37@common
38;------------------------------------------------------------
39   year=vdate/10000
40   month=vdate/100 - year*100
41   day=abs(vdate - year*10000 - month*100)
42   month = abs(month)
43;
44   mm = month & dd = day & yy = year
45;------------------------------------------------------------
46   ndate = n_elements(vdate)
47   if total(mm EQ 0) EQ ndate then mm[*] = 6
48   if total(dd EQ 0) EQ ndate then dd[*] = 15
49   if total(yy EQ 0) EQ ndate THEN yy[*] = -1
50;------------------------------------------------------------
51   return, julday(mm,dd,yy, _EXTRA = ex)
52;------------------------------------------------------------
53   return, -1
54end
55;------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.