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

Last change on this file since 371 was 371, checked in by pinsard, 16 years ago

improvements of headers (alignments of IDL prompt in examples)

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