Why different results for julian formats entered

Started by twgonder, July 03, 2021, 16:39:45

Previous topic - Next topic

twgonder

I found a program in the documentation for julian.
Entering 03/07/21 and 03, 07, 21 return different results.
Is there a reason for this?

jsalai

Quote from: twgonder on July 03, 2021, 16:39:45
I found a program in the documentation for julian.
Entering 03/07/21 and 03, 07, 21 return different results.
Is there a reason for this?

yes, there is!
https://smallbasic.github.io/reference/577.html

Returns the Julian date. (dates must be greater than 1/1/100 AD).

try this:
?julian("03/07/2021")
?julian(03,07,2021)
pause:end

I won't belong to any organization that would have people like me as members.
[Groucho Marx]

twgonder

#2
Quote from: jsalai on July 03, 2021, 21:16:23
yes, there is!
https://smallbasic.github.io/reference/577.html

Returns the Julian date. (dates must be greater than 1/1/100 AD).

try this:
?julian("03/07/2021")
?julian(03,07,2021)
pause:end


I did see that in the manual, but I often do tests to see how correct the manual is. As you can see, using a 2 year number for  AD 21 should work the same as you're not going to enter 0021. In many cases as the leading zeros would be dropped in variables.
a = 0021: ? a (result is 21)

Despite what the manual says, the year 21 in one format seems to work, but I didn't check to see if it returned a correct answer.