Re: Subroutine to find the Julian Date


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Robert G Laurin on January 10, 2006 at 13:19:42:

In Reply to: Subroutine to find the Julian Date posted by Greg on January 10, 2006 at 11:46:54:

I have a routine that takes recognisable date and convert it to known format types - including Julian.

Specifically for Julian:

Parse the date as DAY, MONTH and YEAR where Year is relative to 1900.

Figure out leap year as such:

LET LeapYear=2
IF FPT((YEAR+1900)*.2500) = 0 THEN LeapYear = 1 ! Every 4 Years
IF FPT((YEAR+1900)*.0100) = 0 THEN LeapYear = 2 ! Not Every 100
IF FPT((YEAR+1900)*.0025) = 0 THEN LeapYear = 1 ! But Every 400

LET DayOfYear = INT(MONTH * 275 / 9.00) + DAY - 30
IF MONTH > 2 THEN DayOfYear = DayOfYear - LeapYear

LET JULIAN = YEAR * 1000 + DayOfYear

Been using this for 20+ years and it works just fine !

Hope you like it !!!


Robert



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):






[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]