SmallBASIC syntax groups: 

Date function JULIAN

20  JULIAN (dmy| (d,m,y))
Returns the Julian date. (dates must be greater than 1/1/100 AD).

See examples

If there is insufficient information on this page and you wish learn more about JULIAN, please send an email to smallbasic@gmail.com. You can help to improve information about JULIAN by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.

PRINT Julian(31, 12, 2001)


Earlier this month I had done some code to calculate Oil Tank usage and used a ridiculously long and complex formula for calculating the number of days between two dates. I should have used the julian date function:

REM julian demo.bas 2016-02-28 SmallBASIC 0.12.2 [B+=MGA]
'oh julian returns the number of days since 1/1/100

'it is perfect for calculating the number of days between two dates

'but the date given to the julian function must be in form dd/mm/yyyy or m,d,y (see help)

'Date just so happens also returns in dd/mm/yyyy format so...

? "Today is ";date
input "To test what julian returns, enter a date dd/mm/yyyy ";adate
? "julian(";adate;") returns: ";julian(adate)
? "That is/was ";abs(julian(adate)-julian(date));" days from today."
?:input "To test the other format julian accepts enter a date as: dd,mm,yyyy(enter) ";d,m,y
? "That is/was ";abs(julian(d,m,y)-julian(date));" days from today."
?:? "Again julian is excellent for calculating the number of days between two dates."