Page 1 of 1

Bug in Date()

Posted: Mon Feb 10, 2025 3:23 pm
by Fritz
Hello fans of PB,

I noticed something mysterious in the Date()-Bibo:
If I add four days to 01.01.1901, then 10.02.2037 is displayed:

Code: Select all

date = Date(1901, 1, 1, 0, 0, 0)
Debug FormatDate("%dd.%mm.%yyyy", AddDate(date, #PB_Date_Day, 4))
If I enter the year 1902, then I correctly arrive at 05.01.1902.
The error is probably in the AddDate()-Bibo.

Can you reproduce this?
I am working with PB 6.12 32-Bit under Windows 11 x64.

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)

Re: Bug in Date()

Posted: Mon Feb 10, 2025 3:36 pm
by User_Russian
It must be

Code: Select all

date.q = Date(1901, 1, 1, 0, 0, 0)
Debug FormatDate("%dd.%mm.%yyyy", AddDate(date, #PB_Date_Day, 4))

Re: Bug in Date()

Posted: Mon Feb 10, 2025 3:58 pm
by Fritz
Thank you very much!