adddate() add 1 day, increases month by 3?

Just starting out? Need help? Post your questions and find answers here.
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

adddate() add 1 day, increases month by 3?

Post by jassing »

Code: Select all

#fmt = "%yyyy %mm %dd %hh %ii %ss"
test.q = Date( Year(  Date() ) , 
               Month( Date() ) , 
               Day(   Date() ) , 
               00 , 
               29 , 
               00 )
Debug  FormatDate( #fmt, test )
Debug Month(test)
test = AddDate( test, 1, #PB_Date_Day )
Debug  FormatDate( #fmt, test )
Debug Month(test)
results in
[18:05:23] 2024 04 12 00 29 00
[18:05:23] 4
[18:05:23] 2024 07 12 00 29 00
[18:05:23] 7
What am i doing wrong?
User avatar
Kiffi
Addict
Addict
Posts: 1509
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: adddate() add 1 day, increases month by 3?

Post by Kiffi »

You have swapped the AddDate() parameters
AddDate()-Help wrote:
Syntax: Date = AddDate(Date, Type, Value)
AddDate( test, 1, #PB_Date_Day ) -> AddDate( test, #PB_Date_Day, 1 )
Hygge
jassing
Addict
Addict
Posts: 1885
Joined: Wed Feb 17, 2010 12:00 am

Re: adddate() add 1 day, increases month by 3?

Post by jassing »

Kiffi wrote: Sat Apr 13, 2024 2:10 am You have swapped the AddDate() parameters
Thanks.

even reading help, it didn't dawn on me... long day.

thanks
-j
Post Reply