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

Last change on this file since 242 was 231, checked in by pinsard, 17 years ago

improvements/corrections of some *.pro headers

  • Property svn:keywords set to Id
File size: 789 bytes
Line 
1;+
2;
3; @file_comments
4; gives yyyymmdd date equivalent of a Julian day
5;
6; @categories
7; Calendar
8;
9; @param jday {in}{required} {type=double}
10; Julian day
11;
12; @returns
13; date in yyyymmdd format
14;
15; @examples
16;
17; IDL> print, jul2date(julday(12,23,1999))
18;        19991223
19;
20; @history
21; Sebastien Masson (smasson\@lodyc.jussieu.fr)
22;                       June 2005
23;
24; @version
25; $Id$
26;
27;-
28;
29function jul2date, jday
30;
31  compile_opt idl2, strictarrsubs
32;
33  caldat, jday, month, day, year, hour, min, sec
34;
35  res = (10000L*year + 100L*month + day)*(year GE 0) $
36        +( 10000L*year - 100L*month - day)*(year LT 0)
37;
38  IF total([hour NE 12, min NE 0, abs(sec) GE 1.e-4]) EQ 0 THEN return, long(res) $
39  ELSE return, double(res) + (hour / 24.0d0) + (min/1440.0d0) + (sec / 86400.0d0)
40
41end
Note: See TracBrowser for help on using the repository browser.