Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Julian day function

1. ## Julian day function

Hi,

Please find a small function which we wrote to calculate the julian day (the integer number of an year) of the year:

This was an authentication requirement in our banking application..

'

Dim dDate:dDate = "05/01/2008" 'Julian day is 5

nJulianDay = CalculateJulianDay(dDate)

Public Function CalculateJulianDay (ByVal dDate)

Dim nJulianDay

Dim sYear : sYear = Year(dDate)

Dim sFirstDayOfYear : sFirstDayOfYear = "01/01/" &amp; sYear

nJulianDay = DateDiff("d", Cdate(sFirstDayOfYear), dDate) + 1

CalculateJulianDay = nJulianDay

End Function

Note: (For further ref
1) http://en.wikipedia.org/wiki/Julian_day
2) There is difference between Julian date and day calculation.

Do let me know for any comments / corrections.

Thanks,
Jeeva

2. ## Re: Julian day function

From the wikipedia article you have mentioned:

The Julian day or Julian day number (JDN) is the integer number of days that have elapsed since an initial epoch defined as noon Universal Time (UT) Monday, January 1, 4713 BC

So why would you want to calculate it from 1st of every year?

I think you are trying to refer to Ordinal Date
http://en.wikipedia.org/wiki/ISO_8601#Ordinal_dates

3. ## Re: Julian day function

Suchit,

From the banking AUT (foreign exchange page authentication) context, the integer day-of-the-year is used to ensure the teller has retrieved the latest exchange rate. Hence I have used 1st day of year. I tried to use the convention used by the bank IT team..

I went through the Ordinal Date detail 'YYYY-DDD' - which is comprised of 'Year' and 'day of the year', where 'day of the year' is the julian day number. In simple terms..

'The Julian day number can be considered a very simple calendar, where its calendar date is just an integer' (when you scroll-down the wikipedia article..)

found the below page when i tried to google,

Julian day: A method for expressing dates. The days in the year are numbered consecutively from 1 to 365 (http://www.sortie-nd.org/help/manual.../glossary.html)

I think we may also use the term 'integer day of the year' for better clarity..

Cheers!
Jeeva

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:27 PM.