Dave Merrill
03/09/2025, 1:27 PMBill Nourse
03/09/2025, 6:26 PMDave Merrill
03/09/2025, 8:12 PMDave Merrill
03/09/2025, 8:15 PMBill Nourse
03/09/2025, 8:30 PMDave Merrill
03/09/2025, 9:24 PMTomy Saman
03/09/2025, 10:55 PMDave Merrill
03/10/2025, 12:33 PMDave Merrill
03/10/2025, 2:44 PM<cfset result = isDate("3/9/2025 2:45 am")>
<cfoutput>#result#</cfoutput>
Message: Date value passed to date function createDateTime is unspecified or invalid.
Detail: Specify a valid date in createDateTime function.
But on CF Docs, it shows Yes, for all offered versions of ACF.
Why is that?
And just to say it, that answer is wrong, it's NOT valid, that hour was skipped that night in this timezone, as noted above.
CF Docs result is the same if I don't set the timezone, which defaults to Etc/UTC, or if I set it to America/New_York, which is my local.
One possible reason for the isDate() difference is java versions.
Locally, server.system.properties.java.version is 11.0.26, which I think is what's spec'd for CF2021
However, on CF Docs it's 1.8.0_292, which I don't understand, not the spec'd version.
No idea if that's responsible for the differing isDate() results.
I'd appreciate it if some of you could try running that snippet and let me know what happens, and your versions of ColdFusion and java.
Thanks.Jim Frankowski
03/10/2025, 3:17 PM<cfloop index="i" from="8" to="10">
<cftry>
<cfset somedate = "3/#i#/2025 2:45 am">
<cfset result = isDate(somedate)>
<cfoutput><p>#datetimeformat(somedate,"long")# --- #result#</p></cfoutput>
<cfcatch type = "any">
<cfset somedate = now()>
<cfset result = isDate(somedate)>
<cfoutput><p>#datetimeformat(somedate,"long")# --- #result#</p></cfoutput>
</cfcatch>
</cftry>
</cfloop>
Looking at the "long" output, the date/time goes from EST to EDT. Not really sure how to address that, though.Matt Jones
03/10/2025, 3:30 PMJim Frankowski
03/10/2025, 3:57 PM<cfloop index="i" from="8" to="10">
<cftry>
<cfset result = isDate("3/#i#/2025 2:45 am")>
<cfoutput><p>#datetimeformat('3/#i#/2025 2:45 am',"long")# --- #result#</p></cfoutput>
<cfcatch type = "any">
<cfset result = isDate("#now()#")>
<cfoutput><p>#datetimeformat("#now()#","long")# --- #result#</p></cfoutput>
</cfcatch>
</cftry>
</cfloop>
Bill Nourse
03/10/2025, 4:01 PMJim Frankowski
03/10/2025, 4:07 PMDave Merrill
03/10/2025, 7:23 PMMatt Jones
03/10/2025, 7:31 PMDave Merrill
03/10/2025, 7:42 PMTomy Saman
03/10/2025, 11:34 PMTomy Saman
03/10/2025, 11:44 PMon cfdocs, isdate() behaves differently if you pass it a string vs if you give it a variable set to that string.This is a weird behaviour for CF...
salted
03/11/2025, 3:18 AMsalted
03/11/2025, 3:18 AMsalted
03/11/2025, 3:19 AMsalted
03/11/2025, 3:21 AMsalted
03/11/2025, 3:21 AMsalted
03/11/2025, 3:22 AMMatt Jones
03/11/2025, 1:43 PMmaintenanceTime = createDateTime( year(now()), month(now()), day(now()), 2, 55, 0 )
works every day of the year except when that time lands during the lost hour as the clock springs forward.salted
03/11/2025, 1:44 PMDave Merrill
03/11/2025, 2:06 PMDave Merrill
03/13/2025, 12:42 PMzackster
03/13/2025, 12:50 PMzackster
03/13/2025, 12:55 PMDave Merrill
03/13/2025, 1:02 PMzackster
03/13/2025, 1:04 PMDave Merrill
03/13/2025, 1:09 PMzackster
03/13/2025, 1:13 PMzackster
03/13/2025, 1:14 PMbrettpr
03/13/2025, 1:46 PMDave Merrill
03/13/2025, 1:47 PMzackster
03/13/2025, 1:54 PMDave Merrill
03/13/2025, 1:55 PMzackster
03/13/2025, 1:55 PMTomy Saman (Wu)
03/13/2025, 9:09 PMsetTimezone("America/New_York")
test = "3/9/2025 2:45 am"
isDate(test)
But this will NOT blow up in tryCF for ACF 2021 & 2023
setTimezone("America/New_York")
isDate("3/9/2025 2:45 am")
So for your local, you got the 1st test above error out in your local? Or the 2nd test above error out in local?Dave Merrill
03/13/2025, 9:09 PMMark Takata (Adobe)
03/13/2025, 11:00 PMpriyank_adobe
03/14/2025, 7:18 AMDave Merrill
03/14/2025, 1:47 PM