I suspect it's a lot more simple that I'm making it.
I want to add 48 hours to a date that is stored in a table. I first query the database (MS SQL), then insert the new date into a different field in the same table.
I tried this:
<cfset good_until_date = DateAdd('h', 48, good_date.cc_TIC_fridge_start)>
The date that was in the database was: 2017-04-11 18:37:00.000 (this is the date I want to add 48 hour to)
The new (wrong) date is from 6 days prior: 2017-04-05 17:52:00.000
I'm sure I've done something wrong.
Any guidance is appreciated.
Are you sure that it using the correct date. This should work as expected, so I assume the input is wrong.
Simple example here - http://trycf.com/gist/9d3a5f7c6b9c1c904181b7d6930eb7da/undefined?theme=monokai
As you can see it works. Are you outputting cc_TIC_fridge_start or just looking in the database?
Sadly I was updating the incorrect date.
Thanks, I got it to work.