Spec-Zone.ru › ColdFusion

dateConvert

Converts local time to Coordinated Universal Time (UTC), or UTC to local time. The function uses the daylight savings settings in the executing computer to compute daylight savings time, if required.

dateConvert(conversionType, date) → returns date

Member Function Syntax

date.convert(conversionType)

  • CF4+
  • Lucee
  • BL 1.0.0+
  • See Also: getTimeZoneInfo createDateTime

    Argument Reference

    conversionType string
    Required

    local2Utc : Converts local time to UTC time.utc2Local : Converts UTC time to local time.
    Values:
    • local2Utc
    • utc2Local

    date date
    Required

    Compatibility

    ColdFusion:

    Version 4+ Member function is available in CF11+.

    Lucee:

    Member function is not available.

    Examples
    Sample code invoking the dateConvert function

    Converting Local to UTC

    utc_datetime = dateConvert('local2Utc', now());

    Converting UTC to Local

    This example makes sense only if your server time is UTC. now() uses your server settings when creating a datetime object.

    local_datetime = dateConvert('utc2Local', 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/dateconvert

    Spec-Zone.ru

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