Quantcast
Channel: Adobe Community : Unanswered Discussions - ColdFusion
Viewing all articles
Browse latest Browse all 5794

How to get date 30 days from existing date?

$
0
0

I found this codes from this forum: 

#dateformat(dateadd('d', 30, now()),'dd-mmm-yyyy h:mm:ss')# This code works but unfortunately I'm not using Now(). Instead I need to use a user entered Date such as Departure Date, something like 07/06/2013



When I use the above code with my DepartureDate instead of Now() I got a java.util.date error

#dateformat(dateadd( "d", 30, "DepartureDate" ),'dd-mmm-yyyy h:mm:ss')#######

When I get rid of the double quotes in 3rd parameter, I did not get error but the result date is wrong:



When DepartureDate is 07/16/2013,I got 08/30/2013

 

How can I easily add 30 days to my DepartureDate?

 

Thanks

 

#dateformat(dateadd( "d", 30, DepartureDate ),'dd-mmm-yyyy h:mm:ss')######


Viewing all articles
Browse latest Browse all 5794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>