DateAdd('yyyy',1',now()) adds a day?

Execute the following code:

date = '2024-02-04';

This will output:

Same code in T-SQL gives what I would have expected Lucee to return:

declare @today date
SET @today = getdate();
select @today as today
set @today = dateAdd(year,1,@today)
select @today as today_plus_one_year


Curious about this implementation detail?

‘y’ is day of year and ‘yyyy’ is year. trycf reports the same answers between ACF and Lucee.

Yikes, we were just talking about this difference the other day.

Apologies, and thanks!

(how do I delete this post…)

No need to delete anything-- this may be useful to someone in the future with the same question :slight_smile:


by the way, +1 for @taivo because of the great use of the forum editor tools with code snippets and images with dumps, code and SQL screenshots. It’s not usual to see such good posts today! :clap: Don’t delete it!

1 Like

I agree with @andreas and @bdw429s

Information needs to be shared not deleted. Too many great works in the ColdFusion community have already been lost due to websites going down, authors moving on, so on and so forth. ColdFusion is one of the very few languages where code written 20 years ago still works and in some cases is still in production.