source: trunk/SRC/Obsolete/juldate.pro @ 153

Last change on this file since 153 was 134, checked in by navarro, 18 years ago

change *.pro file properties (del eof-style, del executable, set keywords Id

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