CFML Functions

date Category functions

Function Name Description
CreateDate Creates a CFML date object from the given year, month and day
CreateDatetime Creates a CFML date/time object from the given year, month, day, hour, minute, second and optional millisecond
CreateOdbcdate Creates a date object for use with ODBC
CreateOdbcdatetime Creates a date/time object for use with ODBC
CreateOdbctime Creates a time object for use with ODBC
CreateTime Creates a CFML time object from the given hour, minute, second and millisecond, or from the epoch
CreateTimespan Creates a CFML time object that represents a time span/range
DateAdd Adds/Subtracts date units from a given date
DateCompare Compares to date, to the given optional resolution. Returns -1 if date1 is before date2. Returns 1 if date1 is after date2. Returns 0 if equal
DateConvert Converts a date to the given locale
DateDiff Determines the number of given date parts between two different dates
DateFormat Formats a date string to a given output
DatePart Extracts the given date part from the date object
DateTimeformat Formats the date according to the Java SimpleDateFormat convention
Day Returns the day number referenced by the given date
Dayofweek Returns the day of the week the date represents
Dayofweekasstring Returns the string representation of the given day index
Dayofyear Returns the year number referenced by the given date
Daysinmonth Returns the number of days in the month that the date object represents
Daysinyear Returns the number of days in the year of the given date object (taking into account of leap years)
Epoch Returns epoch number that this date represents
Firstdayofmonth Returns the number of the day in the year, the first day of this month falls on
GetBasetagdata Returns back the data associated with the parent tag, at the given depth level back
GetHttptimestring Returns back the time given (or the current time) in the format of the HTTP header
GetNumericdate Returns a real number whose integer part represents the number of days since the EPOCH (12 AM on 12-30-1899) and whose fractional part represents the time value expressed in hours then divided by 24
Hour Returns the hour of the referenced by the date in 24 hour format
IsLeapyear Determines if the given date object ocurrs on a leap year
Millisecond Returns the millisecond of the referenced by the date
Minute Returns the minute of the referenced by the date
Month Returns the month of the referenced date (1=Jan .. 12=Dec)
Monthasstring Returns the string label for the given month index in the given locale (if supplied)
Now Returns the current date and time
Parsedatetime Formats a date string to a given output supports standard formats include SQL, Unix date string and HTTP timestamps.
Quarter Returns the quarter the referenced date falls within (1,2,3,4)
Second Returns the second of the date referenced
Timeformat Formats a time string to a given output
Week Returns the week number in the year of the date referenced
Year Returns the year of the date referenced