Spec-Zone.ru › ColdFusion

dayOfWeek

Determines the day of the week from a date. Returns the ordinal for the day of the week, as an integer in the range 1 (Sunday) to 7 (Saturday).

dayOfWeek(date) → returns numeric

Member Function Syntax

date.dayOfWeek()

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: day dayOfWeekAsString dayOfYear daysInMonth daysInYear firstDayOfMonth

    Argument Reference

    date date
    Required

    Date or datetime object (100AD-9999AD).When passing a datetime object as a string, enclose it in quotation marks. Otherwise, it is interpreted as a numeric representation of a datetime object.

    calendar string
    Default: gregorian

    CF2016u8+ Indicates whether the week starts on Sunday (gregorian) or Monday (iso)
    Values:
    • gregorian
    • iso

    Compatibility

    ColdFusion:

    Member function is available in CF11+.

    Lucee:

    Member function is available in Lucee4.5+. Lucee accepts an additional argument for timezone.

    Examples
    Sample code invoking the dayOfWeek function

    Determines the day of the week

    Uses the dayOfWeek function to determine the day of the week

    <cfset date = createDate(2010, 09, 08)>
    <cfset result = dayOfWeek(date)>
    <cfoutput>#result#</cfoutput>

    Expected Result: 4

    © 2012–present Foundeo, Inc. and the CFDocs contributors.
    Licensed under the MIT License.
    ColdFusion is a trademark of Adobe Systems Incorporated.
    https://cfdocs.org/dayofweek

    Spec-Zone.ru

    Настройки Оффлайн Что нового Помощь О нас
    Spec-Zone .ru
    спецификации, руководства, описания, API