Gregorian to Julian Date conversion

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a class that converts from Gregorian date to TRUE Julian Date in
..NET? Any VB.NET examples available?

ie;
The Julian date is calculated by the number of days since January 1, 4713
BC. For example, the Julian date for August 1, 2001 is 2452122.
 
I've already been to that page in the msdn, but it does not have a method for
getting the "TRUE" julian date. Seems like there would be a method that does
this rather than reinventing the wheel. How can I convert Gregorian to TRUE
julian date?

ie;
The TRUE Julian date is calculated by the number of days since January 1,
4713
BC. For example, the Julian date for August 1, 2001 is 2452122.
 
public double GetJulianDate(DateTime pdtmDate)
{
DateTime dtmStart = new DateTime(1,1,1);
TimeSpan objTS = new TimeSpan(pdtmDate.Ticks - dtmStart.Ticks);
return objTS.TotalDays + 1721637;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top