Welcome to the NavList Message Boards.

NavList:

A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding

Compose Your Message

Message:αβγ
Message:abc
Add Images & Files
    Name or NavList Code:
    Email:
       
    Reply
    Re: Julian Day Number algorithms
    From: Sean C
    Date: 2024 Mar 28, 19:10 -0700

    Paul wrote:

    "To convert JDN to day of week, add 1 then divide by 7. The remainder is day of week, where 0 = Sunday. For instance, 2024 March 19 is JDN 2 460 389. Adding 1 and dividing by 7 yields 2: Tuesday. If you prefer the 0th day of the week on Monday, do not add 1 before division by 7.

    That's exactly how my spreadsheet determines the day of the week for the date that the user inputs. The JD is calculated from the year, month, day, hour, minute and second using a formula from Jean Meeus' Astronomical Algorithms*. Then, the following formula is used to find the day of the week:

    =VLOOKUP(MOD(ROUND(B1,0),7),F70:J76,5)

    ...where "VLOOKUP" is a table lookup referring to cells F70 to J76 - the days of the week starting with Monday as "0", "MOD" is modulo 7 arithmetic, "B1" is the JD and "5" is the number of the column of the table in which the answer will be found.

    Cheers,

    Sean C.

    *

    The following method is valid for positive as well as negative years, but not for negative JD.

    Let Y be the year, M the month number (1 for January, 2 for February, etc., to 12 for December), and D the day of the month (with decimals, if any) of the given calendar date.

    • If M > 2, leave Y and M unchanged. If M = 1 or 2, replace Y by Y - 1, and M by M + 12. In other words, if the date is in January or February, it is considered to be in the 13th or 14th month of the preceeding year.
    • In the Gregorian calendar, calculate A = INT(Y / 100); B = 2 - A + INT(A / 4). In the Julian calendar, take B = 0.
    • The required Julian Day is then: JD = INT(365.25 (Y + 4716)) + INT(30.6001 (M + 1)) + D + B - 1524.5 ([formula] 7.1)

    The number 30.6 (instead of 30.6001) will give the correct result, but 30.6001 is used so that the proper integer will always be obtained. [In fact, instead of 30.6001, one may use 30.601, or even 30.61.] For instance, 5 times 30.6 gives 153 exactly. However, most computer languages would not represent 30.6 exactly - see in Chapter 2 what we said about BCD** - and hence might give a result of 152.999 9998 instead, whose integer part is 152. The calculated JD would then be incorrect.

    In formula (7.1), the constant 4716 has been added to the argument of the first INT function, in order to avoid trouble for negative years.

    ** Binary Coded Decimal

       
    Reply
    Browse Files

    Drop Files

    NavList

    What is NavList?

    NavList is a community devoted to the preservation and practice of celestial navigation and other methods of traditional position-finding. We're a group of navigators, navigation enthusiasts and hobbyists, mathematicians and physicists, and historians interested in all aspects of navigation but primarily those techniques which are non-electronic.

    To post a message, if you are already signed up as a NavList member, start a new discussion or reply to any posted message and use your posting code (this is a simple low-security password assigned when you join). You may also join by posting. Your first on-topic messsage automatically makes you a member, and a posting code will be assigned and emailed to you for future posts.

    Uniquely, the NavList message boards also permit full interaction entirely by email. You can optionally receive individual posts or daily digests by email, and any member can post messages by email (bypassing the web site) by sending to our posting address which is "NavList@NavList.net". This functionality is similar to a traditional Internet mailing list: post by email, read by email, reply by email. Most members will prefer the web interface here for posting and replying to messages.

    NavList is more than an online community... more about that another day.

    © Copyright notice: please note that the rights to all messages and posts in this discussion group are held by their respective authors. No messages or text or images extracted from messages may be reproduced without the explicit consent of the message author. Email me, Frank Reed, if you have any questions.

    Join / Get NavList ID Code

    Name:
    (please, no nicknames or handles)
    Email:
    Do you want to receive all group messages by email?
    Yes No

    A NavList ID Code guarantees your identity in NavList posts and allows faster posting of messages.

    Retrieve a NavList ID Code

    Enter the email address associated with your NavList messages. Your NavList code will be emailed to you immediately.
    Email:

    Email Settings

    NavList ID Code:

    Custom Index

    Subject:
    Author:
    Start date: (yyyymm dd)
    End date: (yyyymm dd)

    Visit this site
    Visit this site
    Visit this site
    Visit this site
    Visit this site
    Visit this site