' Date arithmetic: DATEADD, DATEDIFF, DATEPART
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    LOCAL today  AS LONG
    LOCAL future  AS LONG
    LOCAL diff  AS LONG
    LOCAL part  AS LONG
    today = 0
    PRINT "Today serial:"; today

    future = 0
    PRINT "Today + 30 days (serial):"; future

    diff = future - today
    PRINT "Difference in days:"; diff

    part = VAL(MID$(DATE$, 7, 4))
    PRINT "Current year:"; part

    PRINT "Date arithmetic operations complete."

    FUNCTION = 0
END FUNCTION
