Thread: Formula to convert Calaneder Date to Julian ?

  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Formula to convert Calaneder Date to Julian ?

    My professor is making us do a program that converts calender Date to Julian date and vice versa, I have looked online for one but it gives me the julian day I am looking for the one that continuouly counts from January 1 to December 31 so January 1 will be equal to 1 in julian date january 2 will equal to 2 in julian, November 15 will equal to 319 in julian and so forth.


    I am not very good at math so if someone can help me ....



    Thanks in advance

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,794
    I am not very good at math
    you do not know how to substract two numbers?

    If I tell you that January has 31 days what will be the Julian date 32 correspond to?
    And 45?
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    David J. Wheeler

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Julian day of year formula:

    a = (nDate + 31738) mod 146097 mod 36524 mod 1461
    b= a/1460

    JulianDayofYear = (a-b) mod 365 + b + 1

    Where nDate is equal to the Julian period and all division are integer divisions

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Advancing day by day until it matches a second date
    By nhubred in forum C++ Programming
    Replies: 1
    Last Post: 05-30-2009, 08:55 AM
  2. Checking array for string
    By Ayreon in forum C Programming
    Replies: 87
    Last Post: 03-09-2009, 03:25 PM
  3. Convert a Julian Day to gregorian
    By mapleleafblue in forum C Programming
    Replies: 6
    Last Post: 11-28-2008, 10:09 PM
  4. please help ... to convert date to string
    By mel in forum C Programming
    Replies: 1
    Last Post: 06-12-2002, 10:26 AM