Formula to convert Calaneder Date to Julian ?

This is a discussion on Formula to convert Calaneder Date to Julian ? within the C Programming forums, part of the General Programming Boards category; My professor is making us do a program that converts calender Date to Julian date and vice versa, I have ...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,473
    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?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  3. #3
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,059
    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, 09: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21