Create ODBCdatetime

I have lucee version 5.3.5.92 and try to use the CreatODBCdatetime for the following date that i have received from the last modification date of a picture, e.g.

Sun Nov 01 2020 00:45:22 GMT 0100 (Midden-Europese standaardtijd)

in coldfusion it create the odbc and can insert into my ms sql. In Lucee the same function does not work (no odbc date will be created). Please advise!!

Hamid

Don’t forget to tell us about your stack!

OS: ???
Java Version: ???
Tomcat Version: ???
Lucee Version: ???

Hi @Asgari! Welcome to our community!

I’d always parse that type of date strings to a date object. Did you try that? Something like so:

str = "Sun Nov 01 2020 00:45:22 GMT 0100";
dateObjectLocal = parsedateTime(str,"EEE MMM dd yyyy HH:nn:ss z");
1 Like

Dear Andreas, Many Thanks for your feedback. It works fine.
In ColdFusion it was not necessary to parse.
Thanks again
Hamid

1 Like