Page 1 of 1

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

Posted: Sat Apr 13, 2024 2:06 am
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?

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

Posted: Sat Apr 13, 2024 2:10 am
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 )

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

Posted: Sat Apr 13, 2024 3:19 am
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