For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
Functions l / 

LSParseDateTime

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

Description

Converts a string that is a valid date/time representation in the current locale into a date/time object.

Returns

A date/time object.

Category

Date and time functions, Display and formatting functions, International functions, String functions

Function syntax

LSParseDateTime(date/time-string [, locale, format])

See also

LSDateFormat, ParseDateTime, SetLocale, GetLocale; Locales in the Developing ColdFusion Applications

History

ColdFusion 10: Added the format parameter.

ColdFusion 8: Added the locale parameter.ColdFusion MX:

  • Changed formatting behavior: this function might not parse string formats that worked with earlier releases. This function uses Java standard locale formatting rules on all platforms.
  • Changed how the date/time-string parameter value is processed: ColdFusion processes the date/time-string parameter value time zone information differently than in earlier releases, as described in the Usage section.

Parameters

Parameter

Description

date/time-string

A string a variable that contains one, in a format that is readable in the current locale.

format

Optional, provides the format of the string. This string is used to parse the given date string to date time object.

locale

Locale to use instead of the locale of the page when processing the function

Usage

This function can parse any date, time, or date/time combination that conforms to Java standard locale formatting rules for the current locale.The following table lists some of the date/time values you can pass to this function in the English (US) locale. You can also pass only the date or the time parts of these formats:

Format

Example

m/dd/yy h:mm:ss

1/30/02 7:02:33

m/dd/yy h:mm tt

1/30/02 7:02 AM

m/dd/yyyy h:mm

1/30/2002 7:02 AM

mmm dd, yyyy h:mm:ss tt

Jan 30, 2002 7:02:12 AM

mmmm dd, yyyy h:mm:ss tt zzz

January 30, 2002 7:02:23 AM PST

ddd, mmm dd, yyyy hh:mm:ss

Wed, Jan 30, 2002 07:02:12

dddd, mmmm dd, yyyy h:mm:ss tt zzz

Wednesday, January 30, 2002 7:02:12 AM PST

Valid dates are in the range 100 AD-9999 AD. Two-digit years in the range 00-29 are interpreted as being 2000-2029. Two-digit years in the range 30-99 are interpreted as being 1930-1999. This function corrects for differences between the current time zone and any time zone specified in the input parameter.

  • If a time zone specified in the date/time-string parameter is different from the time zone setting of the computer, ColdFusion adjusts the time value to its equivalent in the computer time zone.
  • If a time zone is not specified in the date/time-stringparameter, ColdFusion does not adjust the time value.

Note:

This function does not accept POP dates, which include a time zone offset value.

In the following example, the parameter formatspecifies the way in which the given date string should be read:

<cfoutput>#lsParseDateTime("01/08/2011","en","MM/dd/yyyy")#</cfoutput>

Example

<h3>LSParseDateTime Example - returns a locale-specific date/time object</h3> 
<!--- loop through a list of locales and show date values for Now()---> 
<cfloop LIST = "#Server.Coldfusion.SupportedLocales#" 
index = "locale" delimiters = ","> 
<cfset oldlocale = SetLocale(locale)> 
<cfoutput><p><B><I>#locale#</I></B><br> 
<p>Locale-specific formats: 
<br>#LSDateFormat(Now(), "mmm-dd-yyyy")# #LSTimeFormat(Now())#<br> 
#LSDateFormat(Now(), "mmmm d, yyyy")# #LSTimeFormat(Now())#<br> 
#LSDateFormat(Now(), "mm/dd/yyyy")# #LSTimeFormat(Now())#<br> 
#LSDateFormat(Now(), "d-mmm-yyyy")# #LSTimeFormat(Now())#<br> 
#LSDateFormat(Now(), "ddd, mmmm dd, yyyy")# #LSTimeFormat(Now())#<br> 
#LSDateFormat(Now(), "d/m/yy")# #LSTimeFormat(Now())#<br> 
#LSDateFormat(Now())# #LSTimeFormat(Now())#<br> 
<p>Standard Date/Time: 
#LSParseDateTime("#LSDateFormat(Now())# #LSTimeFormat(Now())#")#<br> 
</cfoutput> 
</cfloop>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices