steffengy / tiberius

TDS 7.4 (mssql / Microsoft SQL Server) async driver for rust. Fork at: https://github.com/prisma/tiberius
Apache License 2.0
150 stars 2 forks source link

milliseconds are lost when using chrono::NaiveDateTime #66

Closed bbigras closed 6 years ago

bbigras commented 6 years ago

I use a NaiveDateTime to fetch a DATETIME2(7) and insert it back into a DATETIME2(7) in another table but I lose the nanoseconds.

2018-06-22 15:06:36.5930000 becomes 2018-06-22 15:06:36.0000000

I didn't try tiberius::ty::DateTime2.

steffengy commented 6 years ago

Let me know, if this doesn't fix most of it.

bbigras commented 6 years ago

I got more precision now but it seems 2018-05-15 10:46:11.3230000 becomes 2018-05-15 10:46:11.3200000

bbigras commented 6 years ago

Can we re-open this issue?

steffengy commented 6 years ago

It's a different issue, but sure (datetime2 being sent as datetime)

steffengy commented 6 years ago

@bbigras should be fixed in 1d4c021715d741fc9c60eb737f03f66963f2e1fb

bbigras commented 6 years ago

It seems to work. Thanks!