source: trunk/SRC/Calendar/jul2date.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:executable set to *
File size: 953 bytes
Line 
1;------------------------------------------------------------
2;------------------------------------------------------------
3;------------------------------------------------------------
4;+
5;
6; @file_comments gives yyyymmdd date equivalent of a julian day
7;
8; @categories calendar
9;
10; @param jday {in}{required} julian day
11;
12; @returns date in yyyymmdd format
13;
14; @examples
15;
16;    IDL> print, jul2date(julday(12,23,1999))
17;        19991223
18;
19; @history Sebastien Masson (smasson\@lodyc.jussieu.fr)
20;                       June 2005
21;-
22;------------------------------------------------------------
23;------------------------------------------------------------
24;------------------------------------------------------------
25function jul2date, jday
26;
27  compile_opt idl2, strictarrsubs
28;
29
30  caldat, jday, month, day, year
31
32  res = (10000L*year + 100L*month + day)*(year GE 0) $
33        +( 10000L*year - 100L*month - day)*(year LT 0)
34
35  return, long(res)
36end
Note: See TracBrowser for help on using the repository browser.