Fixed
Details
Assignee
Michael OffnerMichael OffnerReporter
Marianna ShvartsapelMarianna ShvartsapelPriority
NewLabels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Marianna Shvartsapel
Marianna ShvartsapelPriority
Labels
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
None
Created 11 January 2018 at 22:26
Updated 1 February 2018 at 16:37
Resolved 25 January 2018 at 14:05
<cfset timeStamp = "2018-01-04-23.40.56"> <cfset newTimeStamp = parseDateTime(timeStamp, "yyyy-MM-dd-HH.nn.ss")> <cfoutput>#newTimeStamp#</cfoutput>
I know this is a bit of an unconventional format - but this is what I have to work with and this is why I am providing the pattern describing my expected format.
I also tried it with single quotes around the dash between the date and time parts:
"yyyy-MM-dd'-'HH.nn.ss"
as well as using "mm" for minutes:
""yyyy-MM-dd'-'HH.mm.ss"
In all cases I get
"can't cast value [2018-01-04-23.40.56] to a Date Object"
error
Using "nn" for minutes works in ACF and produces correct output:
{ts '2018-01-04 23:40:56'}
(according to http://cflive.net)
Stacktrace:
lucee.runtime.exp.ExpressionException: can't cast value [2018-01-04-23.40.56] to a Date Object
at lucee.runtime.op.date.DateCaster.toDateAdvanced(DateCaster.java:486)
at lucee.runtime.functions.string.ParseDateTime._call(ParseDateTime.java:45)
at lucee.runtime.functions.string.ParseDateTime.call(ParseDateTime.java:39)
at _34f00148_ba4f_4c58_a76deba685b01720_cfm1890$cf.call(/code/34F00148-BA4F-4C58-A76DEBA685B01720.cfm:11)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:893)
at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:838)
at lucee.runtime.listener.ClassicAppListener._onRequest(ClassicAppListener.java:63)
at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44)
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2394)
at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2385)
at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2353)
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:917)
at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:102)
at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:872)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)