Bug in Date()

Just starting out? Need help? Post your questions and find answers here.
Fritz
New User
New User
Posts: 2
Joined: Thu Sep 26, 2024 7:44 am
Location: Germany

Bug in Date()

Post 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)
User_Russian
Addict
Addict
Posts: 1588
Joined: Wed Nov 12, 2008 5:01 pm
Location: Russia

Re: Bug in Date()

Post 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))
Fritz
New User
New User
Posts: 2
Joined: Thu Sep 26, 2024 7:44 am
Location: Germany

Re: Bug in Date()

Post by Fritz »

Thank you very much!
Post Reply