Spec-Zone.ru › ColdFusion

hour

Extracts the hour of the day from a date/time object. Ordinal value of the hour, in the range 0 - 23.

hour(date) → returns numeric

Member Function Syntax

date.hour()

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: minute second month quarter week year

    Argument Reference

    date date
    Required

    Date/time object, in the range 100 AD-9999 AD.NOTE: When passing a date/time value as a string, enclose it in quotation marks. Otherwise, it is interpreted as a number representation of a date/time object.

    Compatibility

    ColdFusion:

    Member function is available in CF11+.

    Lucee:

    Member function is available in Lucee4.5+.

    Examples
    Sample code invoking the hour function

    Hour of a datetime object

    dt = createdatetime(2016,1,1,5,30,25);
    h = hour( dt );
    writeoutput( h );

    Expected Result: 5

    Current Hour of the day

    hour( now() )

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

    Spec-Zone.ru

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