Not finding what you are looking for? Request a recipe!
Use the dateDiff() function to do the conversion. If you are converting from local time, you'll first need to convert your date/time to GMT(Greenwich Mean Time) using dateConvert().
You can write the date/time value as a string, or use the createDate(), createTime(), createDateTime(), or createODBCDate() function depending on your specific needs.
Use the datePart() function or one of ColdFusion's other functions for the corresponding date part you want to return such as hour(), minute(), second(), month(), day(), dayOfWeek(), week(), month(), quarter(), or year().
Use dateDiff() to return the interval between two dates and/or times. The dateDiff() function is used to return the interval between two dates or times. The function takes three parameters, the interval for the comparison, and the two dates you want to compare.
Use dateAdd() to add the Epoch seconds to the Epoch date.
The parseDateTime() function, and its locale specific sibling LSParseDateTime() can be used to convert an arbitrary date/time string into a date/time object. Additionally, parseDateTime() (but not LSParseDateTime()) can be used to convert the supplied date/time from local time to GMT (Greenwich Mean ...
Use one of ColdFusion's comparison operators in an expression, or use the dateCompare() function.
Use isDate() or LSIsDate() for strings, or isNumericDate() for numeric values.
Use the now() function.
Use the dateAdd() function.