4.0

4.0 | 1 rating Rate this file 7 Downloads (last 30 days) File Size: 2.05 KB File ID: #11243

greg2julian

by Gabriel Ruiz

 

31 May 2006 (Updated 06 Jun 2006)

This function converts the Gregorian dates to Julian dates.

| Watch this File

File Information
Description

0. Syntax: [JD,julianday] = juliandate(year,month,day,hour,min,sec)

1. Inputs:
year, month, day = date in Gregorian calendar.
hour,min,sec = time at Universal Time.

2. Outputs:
JD = Julian date.
julianday = day of week.

3. Example:
>> [a,b] = greg2julian(2006,5,30,2,30,28)
a =
    2453885.60449074
b =
Tuesday

4. Notes:
- For all common era (CE) dates in the Gregorian calendar, and for more information, check the referents.
- The function was tested, using the julian date converter of U.S. Naval Observatory and the results were similar. You can check it.
- Trying to do the life... more easy with the conversions.

5. Referents:
Astronomical Applications Department. "Julian Date Converter". From U.S. Naval Observatory. http://aa.usno.navy.mil/data/docs/JulianDate.html
Duffett-Smith, P. (1992). Practical Astronomy with Your Calculator. Cambridge University Press, England. pp. 6.
Seidelmann, P. K. (1992). Explanatory Supplement to the Astronomical Almanac.
University Science Books, USA. pp. 5-56.
Weisstein, Eric W. "Julian Date". From World of Astronomy--A Wolfram Web Resource. http://scienceworld.wolfram.com/astronomy/JulianDate.html

Gabriel Ruiz Mtz.
May-2006

Acknowledgements
This submission has inspired the following:
GUI - Calender Convertor
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
19 Sep 2006 David Sterling

Seems to work as advertised. The code is readable and easy to understand. Thanks for the effort Gabriel!

Please login to add a comment or rating.
Updates
06 Jun 2006

To find the days, it was only changed the loop to a cell array. Thanks to Jérôme.

Tag Activity for this File
Tag Applied By Date/Time
clock Gabriel Ruiz 22 Oct 2008 08:27:21
fun Gabriel Ruiz 22 Oct 2008 08:27:21
julian date gregorian date Gabriel Ruiz 22 Oct 2008 08:27:21
astronomy Ned Gulley 20 Feb 2009 11:11:39
julian Ned Gulley 20 Feb 2009 11:11:39
gregorian Ned Gulley 20 Feb 2009 11:11:39
date Ned Gulley 20 Feb 2009 11:11:39

Contact us at files@mathworks.com