Skip to main content
Participating Frequently
Mar 13, 2022 1:28 PM UTC
Question

Spring DST change isDate Date value passed to date function createDateTime is unspecified or invalid

A funny thing happend last night. A loop over the hours hit 2:00 and failed a createDateTime. So I added guard programming to test validity using isDate(), to skip the items in spring forward DST are not there (2:00 hour). It still failed. Apparently isDate is build on top of createdateTime, but instead of capturing it internally and returning false as it should, it throws an exception. This does not seem like the correct behavior for isDate().

Sample code:

 

 

<cfset response = isDate("3/13/2022 02:00:00")>

 

 

Date value passed to date function createDateTime is unspecified or invalid.

coldfusion.util.DateUtils$InvalidDateException: Date value passed to date function createDateTime is unspecified or invalid.
at coldfusion.util.DateUtils.createDateTime(DateUtils.java:1503)
at coldfusion.runtime.CFDateTimeParser.toDateTime(CFDateTimeParser.java:592)
at coldfusion.runtime.CFDateTimeParser.parseTime(CFDateTimeParser.java:356)
at coldfusion.runtime.CFDateTimeParser.parseTime(CFDateTimeParser.java:316)
at coldfusion.runtime.CFDateTimeParser._parseDateTime(CFDateTimeParser.java:160)
at coldfusion.runtime.CFDateTimeParser.parseDateTime(CFDateTimeParser.java:88)
at coldfusion.util.DateUtils._parseDateTime(DateUtils.java:1050)
at coldfusion.util.DateUtils.isDate(DateUtils.java:1032)
at coldfusion.runtime.CFPage.IsDate(CFPage.java:3676)
at cfgctest2ecfm1330162049.runPage(C:\ColdFusion2021\cfusion\wwwroot\testDate.cfm:1)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:257)
at coldfusion.tagext.lang.IncludeTag.handlePageInvoke(IncludeTag.java:749)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:578)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:605)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:43)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:162)
at coldfusion.filter.IpFilter.invoke(IpFilter.java:45)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:30)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:97)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:81)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:60)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.CfmServlet.service(CfmServlet.java:232)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:311)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:46)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at coldfusion.inspect.weinre.MobileDeviceDomInspectionFilter.doFilter(MobileDeviceDomInspectionFilter.java:57)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:47)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:359)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1589)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)

 

 

    This topic is closed to new replies. Start a new post to keep the conversation going.

    9 replies

    BKBK
    Community Expert
    Community Expert
    Mar 14, 2022 9:17 AM UTC

     

    <cfset response = isDate("3/13/2022 02:00:00")>

     

    Date value passed to date function createDateTime is unspecified or invalid.

    coldfusion.util.DateUtils$InvalidDateException: Date value passed to date function createDateTime is unspecified or invalid.
    at coldfusion.util.DateUtils.createDateTime(DateUtils.java:1503)
    at coldfusion.runtime.CFDateTimeParser.toDateTime(CFDateTimeParser.java:592)
    at coldfusion.runtime.CFDateTimeParser.parseTime(CFDateTimeParser.java:356)
    at coldfusion.runtime.CFDateTimeParser.parseTime(CFDateTimeParser.java:316)
    at coldfusion.runtime.CFDateTimeParser._parseDateTime(CFDateTimeParser.java:160)
    at coldfusion.runtime.CFDateTimeParser.parseDateTime(CFDateTimeParser.java:88)
    at coldfusion.util.DateUtils._parseDateTime(DateUtils.java:1050)
    at coldfusion.util.DateUtils.isDate(DateUtils.java:1032)
    at coldfusion.runtime.CFPage.IsDate(CFPage.java:3676)
    at cfgctest2ecfm1330162049.runPage(C:\ColdFusion2021\cfusion\wwwroot\testDate.cfm:1)

    ...


    By @Greg Campbell

     

    This is in any case a bug. The reason being that ColdFusion's underpants are showing. ColdFusion is reporting an exception (coldfusion.util.DateUtils$InvalidDateException) that is being thrown at one of its own internal functions (createDateTime).

    Translate
    BKBK
    Community Expert
    Community Expert
    Mar 14, 2022 9:26 AM UTC

    @Greg Campbell and @joseph.yan ,

    Does the following help as a workaround?

    • add the timezone flag to java.args in the jvm.config file. For example, I have added:
      -Duser.timezone=Europe/London
    Translate
    Charlie Arehart
    Community Expert
    Community Expert
    Mar 13, 2022 2:38 PM UTC

    Greg, it seems this is more a statement/observation by you rather than a question, and fair enough. Perhaps someone, including Adobe, may chime in with thoughts or some workaround.

     

    But I'd think it would be good if you filed this as a bug report, at tracker.adobe.com. If you do, please do share the ID number or link here, and you may want to link that to this forum post.

     

    Also, it could help if you'd indicate also (here and there) what cf version and update level (as well as Java level) you're running, all reported on the cf admin settings summary page. If you're not on the latest update of your cf version or jvm, this could be a bug in one of those, since fixed. 

     

    Hope that helps. 

    Translate
    /Charlie (troubleshooter, carehart. org)
    Inspiring
    Mar 13, 2022 7:11 PM UTC

    Just added this bug:
    https://tracker.adobe.com/#/view/CF-4212875

    Translate
    Charlie Arehart
    Community Expert
    Community Expert
    Mar 14, 2022 3:30 AM UTC

    Joseph, since you're not Greg (but opened the ticket today and reported it here), can you clarify: do you work with him? Or are you getting the same error?

     

    And you did not indicate there what Java version you're using. Again, that may be important. I see you reported being on 2021 update 3.

     

    Again, Greg, hope you will clarify your cf and Java versions. 

    Translate
    /Charlie (troubleshooter, carehart. org)