DatePart ("datepart", "date") DescriptionThis returns part of a date as a number. datepart can be one of the following; yyyy, year; q, quarter; m, month; y, day of year; d,day;w, weekday; ww, seek; h, hour; n, minute; s, second. Example<cfset exampleDate = now()> <cfoutput> year: #DatePart("yyyy", exampleDate)# quarter: #DatePart("q", exampleDate)# month: #DatePart("m", exampleDate)# day of year: #DatePart("y", exampleDate)# day: #DatePart("d", exampleDate)# weekday: #DatePart("w", exampleDate)# week: #DatePart("ww", exampleDate)# hour: #DatePart("h", exampleDate)# minute: #DatePart("n", exampleDate)# second: #DatePart("s", exampleDate)# </cfoutput> |