Calculates Julian Date.
The example below uses Today, but any valid date object will work.
Dim dt As New notesdatetime(Today)
Dim x As Long, y As Long
'Get the correct julian day
x& = Datenumber(Year(dt.localtime),Month(dt.Localtime),Day(dt.LocalTime))
y& = Datenumber(Year(dt.localtime),1,1)
tdif = Trim(Str((x& - y&) + 1))
threedigit = Right("000",3-Len(tdif)) + tdif ' Pad julian date with 0's
Msgbox "Today's julian date is: " + threedigit
This was first published in November 2000
Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.