ColdFusion Programming/dates

Coldfusion can handle the creation, modification, display, and usage of dates.

Setting a Date
In order to set a date use the cfset function. 

Displaying a Date
The basic display of a date is simply to output it. This would display: 12/3/2006
 * 1) mydate#

There is function that allows you to easily convert a date into another format.
 * 1) dateformat(mydate, 'yyyy/mm/dd')#

This would display: 2006/12/3

The options to be used here are: The options can be separated by - /, or space to create the format that you want.
 * d: Day of the month as digits, no leading zeros
 * dd: Day of the month as digits
 * ddd: Day of the week, abbr.
 * dddd: Day of the week, name
 * m: Month as digits, no leading zero
 * mm: Month as digits
 * mmm: Month as abbr.
 * mmmm: Month as name.
 * y: Year - last two digits, no leading zeros
 * yy: Year - last two digits
 * yyyy: Year - four digits

Modifying a date
If we want to add 5 days to today we would use this function. 

The options for dateadd are:
 * yyyy: Year
 * q: Quarter
 * m: Month
 * y: Day of year
 * d: Day
 * w: Weekday
 * ww: Week
 * h: Hour
 * n: Minute (remember m is for month not minute)
 * s: Second