Spec-Zone.ru › ColdFusion

lsDateFormat

Formats the date part of a date/time value in a locale-specific format. [mask - quicky] d,dd,ddd,dddd: Day of month / week m,mm,mmm,mmmm: Month y,yy,yyyy: Year gg: Period/era string short / medium / long / full

lsDateFormat(date [, mask, locale]) → returns string

Member Function Syntax

date.lsDateFormat([mask, locale])

  • CF
  • Lucee
  • BL 1.0.0+
  • See Also: lsTimeFormat dateFormat

    Argument Reference

    date date
    Required

    The datetime object

    mask string
    Default: medium

    A keyword or custom combination of components
    Values:
    • short
    • medium
    • long
    • full

    locale string

    CF 8+ Locale to use instead of the locale of the page when processing the function

    Compatibility

    ColdFusion:

    Member function is available in CF11+.

    Lucee:

    Member function is available in Lucee4.5+.

    Examples
    Sample code invoking the lsDateFormat function

    Tag Example

    lsDateFormat formats the date part of a date/time value using the locale convention.

    <!--- loop through a list of locales; show date values for now()---> 
     <cfloop list = "#Server.Coldfusion.SupportedLocales#" 
     index = "locale" delimiters = ","> 
     <cfset oldlocale = setLocale(locale)> 
      <cfoutput><p><B><I>#locale#</I></B> 
     #lsDateFormat(now(), "mmm-dd-yyyy")# 
     #lsDateFormat(now(), "mmmm d, yyyy")# 
     #lsDateFormat(now(), "mm/dd/yyyy")# 
     #lsDateFormat(now(), "d-mmm-yyyy")# 
     #lsDateFormat(now(), "ddd, mmmm dd, yyyy")# 
     #lsDateFormat(now(), "d/m/yy")# 
     #lsDateFormat(now())# 
     <hr noshade> 
     </cfoutput> 
     </cfloop> 

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

    Spec-Zone.ru

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