• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

LSParseDateTime

New Here ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

I have a Problem with parsing dates.

Why does #LSParseDateTime(Now())# produce an error while  #LSIsDate(Now())# answers with 'YES' ? locale is German (Standard)

My ColdFusion Code:

  Now() : #Now()# <br>
  LSIsDate(Now()): #LSIsDate(Now())# <br>
  LSParseDateTime(Now()): #LSParseDateTime(Now())# <br>

Output:

Now() : {ts '2013-05-15 12:56:27'}

LSIsDate(Now()): YES

LSParseDateTime(Now()):   

The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.

{ts '2013-05-15 12:56:27'} is an invalid date or time string.


The error occurred in E:\InetPub\wwwroot\tests\OP\emptime.cfm: line 71
69 :       Now() : #Now()# <br> 
70 :       LSIsDate(Now()): #LSIsDate(Now())# <br>
71 :       LSParseDateTime(Now()): #LSParseDateTime(Now())# <br>
72 : 

How can this be and how to solve this problem???????

Views

403

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 15, 2013 May 15, 2013

Copy link to clipboard

Copied

LATEST

Now() returns a date object.  LSParseDateTime expects a string that looks like a date as expressed in your current locale, e.g. "31-12-2013" or "12-31-2013" etc.

What are you trying to do? - as Now() is already a date object, there's no reason I can see why you'd use ParseDateTime / LSParseDateTime to try and convert it into a date.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation