Lucee and MSSQL DateTime2 datatype


I can’t seem to find any information on Google at the moment on this.

What’s the best way of handling the datetime2 datatype in MS SQL Server and

The datetime2 is a more accurate datatype than the datetime type, more
right hand decimal places are returned. e.g.

2016-05-09 13:07:47.6483644 is returned from a query.

This seems to have an issue in Lucee in that it adds time to the object.
So the following code

writeOutput(“2016-05-09 13:07:47.6483644” & " == " & timeFormat(“2016-05-09
13:07:47.6483644”, “HH:mm:ss”));


2016-05-09 13:07:47.6483644 == 14:55:50

Whereas, if I cast the date as a datetime datatype I get:

writeOutput(“2016-05-09 13:07:47.647” & " == " & timeFormat(“2016-05-09
13:07:47.647”, “HH:mm:ss”));

which outputs

2016-05-09 13:07:47.647 == 13:07:47

Kind regards