tbt103...Here is what I use for both functions. (I am in the middle of changig systems and am more messed up than usual) I have never had a problem with either but also do not work with time (h:m:s)in my dates.
Public Function DateFor(JDN, JGMode)
Dim JG, M, Y
Dim DV As String
Dim D, G, Q, R, S, T, U, V As Double 'JD changed to JDN
JG = UCase(Left(JGMode, 1)): If JG <> "J" Then JG = "G"
If JG = "J" Then G = 0 Else G = 1
Q = G * Int((JDN / 36524.25) - 51.12264)
R = JDN + G + Q - Int(Q / 4)
S = R + 1524
T = Int((S / 365.25) - 0.3343)
U = Int(T * 365.25)
V = Int((S - U) / 30.61)
' Compute the raw, numerical calendar date elements
D = S - U - Int(V * 30.61)
M = (V - 1) + 12 * (V > 13.5)
Y = T - (M < 2.5) - 4716
' Here you have numerical values of D, M and Y
‘ Must convert into Some Date Format of your choice
' Day of the month (1 to 31)
D = Trim(D)
' Determine English month abbreviation (Jan to Dec)
M = " " & _
Mid("JanFebMarAprMayJunJulAugSepOctNovDec", 3 * (M - 1) + 1, 3)
M = M & " "
' Determine the year in BC|AD format
If Y < 0 Then
Y = Trim(1 - Y) & " BC"
Else
Y = Trim(Y) & " AD"
End If
' Finally, return the computed standard date string in
' the format "1 Jan 2000 BC|AD"
DateFor = D & M & Y
End Function
Public Function Change2JDN(ByVal D, M, Y)
Dim k As Integer
JDN = 0
k = Int((14 - M) / 12)
JDN = D + Int(367 * (M + (k * 12) - 2) / 12) + Int(1461 * (Y + 4800 - k) / 4) - 32113
If Greg = False Then Exit Function
JDN = JDN - (Int(3 * Int((Y + 100 - k) / 100) / 4) - 2)
End Function
Hope this helps. This code is not mine and I do not know whose it is but it has served me for many years.