Sunday, October 11, 2009

DatePart CF function

DatePart
Extracts a part from a date value.
Part of a date, as an integer.

Syntax :
DatePart("datepart", "date")
Parameter Description datepart String:
yyyy: Year
q: Quarter
m: Month
y: Day of year
d: Day
w: Weekday
ww: Week
h: Hour
n: Minute
s: Second
l: Millisecond
When passing a date/time object as a string, you must enclose it in quotation
marks. Otherwise, it is interpreted as a numeric representation of a date/time object.



  • year: #DatePart("yyyy", todayDate)#
  • quarter: #DatePart("q", todayDate)#
  • month: #DatePart("m", todayDate)#
  • day of year: #DatePart("y", todayDate)#
  • day: #DatePart("d", todayDate)#
  • weekday: #DatePart("w", todayDate)#
  • week: #DatePart("ww", todayDate)#
  • hour: #DatePart("h", todayDate)#
  • minute: #DatePart("n", todayDate)#
  • second: #DatePart("s", todayDate)#



source : http://livedocs.adobe.com/coldfusion/6.1/htmldocs/functi60.htm#wp1103355

No comments:

Computers Add to Technorati Favorites Programming Blogs - BlogCatalog Blog Directory