Spec-Zone.ru › ColdFusion

daysInMonth

Determines the number of days in a month.

daysInMonth(date) → returns numeric

Member Function Syntax

date.daysInMonth()

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: day dayOfWeek dayOfWeekAsString dayOfYear 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.

    Compatibility

    ColdFusion:

    Member function is available in CF11+.

    Lucee:

    Lucee allows an optional timezone parameter. Member function is available in Lucee4.5+.

    Examples
    Sample code invoking the daysInMonth function

    Determines the number of days in a month

    Uses the daysInMonth function to determine the number of days in a month

    <cfset Date = CreateDate(2012, 12, 30)>
    <cfset result = daysInMonth(Date)>
    <cfoutput>#result#</cfoutput>

    Expected Result: 31

    Simple example

    To determine the number of days in a month

    <cfset Date = CreateDate(2012, 02, 03)>
    <cfset result = daysInMonth(Date)>
    <cfoutput>#result#</cfoutput>

    Expected Result: 29

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

    Spec-Zone.ru

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