Answered
This topic has been closed for replies.
Hi @Imidi ,
What you observe is unlikely to be a bug. The likely explanation is that your code contains some ambiguity:
- You say the date is 2022-04-06 19:27:24, but it is not. ColdFusion tells you it has evaluated qActivitate.Datetime to be 2022-04-06T19:27:24, which is a date expressed in ISO 8601 UTC format, minus the time-zone part. These two dates are different. Especially when you take point 2. into account.
- Your function,
LSdateformat(qActivitate.Datetime)is a locale-based function. Yet it fails to mention the mask and the locale. ColdFusion is therefore forced to use default values for mask and locale, which may be incompatible with the value 2022-04-06T19:27:24. For details, see the LSDateFormat documentation.
- It is doubtful whether the variable qActivitate.Datetime is a date object. As you can see in the documentation, the first argument of the DateFormat/LSDateformat function should, preferably, be a date object.
To avoid the error, you could try the following alternatives:// Create a date object earlier in the code. <cfset datetimeObject=parseDateTime(qActivitate.Datetime)> // Subsequently... // Using an explicit Locale (Spain/Spanish, for example) lsdateformat(date=datetimeObject, mask="yyyy-mm-dd", locale="es_ES") // Using the locale with which the ColdFusion server is configured lsdateformat(date=datetimeObject, mask="yyyy-mm-dd") // Avoiding specifying the locale dateformat(date=datetimeObject, mask="yyyy-mm-dd")
Sign up
Already have an account? Login
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inSign in to Adobe Community
To post, reply, or follow discussions, please sign in with your Adobe ID.
Sign inEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.
