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

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

header improvements + xxx doc

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