Closed nevi-me closed 5 years ago
MSSQLs timestamp data type is a synoym of the rowversion type, which has no time semantics ("The rowversion data type is just an incrementing number and does not preserve a date or a time. [...] The Transact-SQL timestamp data type is different from the timestamp data type defined in the ISO standard.") https://docs.microsoft.com/de-de/sql/t-sql/data-types/rowversion-transact-sql?view=sql-server-2017
So the only thing that makes sense is reading it into an u64
, which probably currently won't work.
Maybe you can read it into a Vec<u8>
, but not sure.
If your goal is to use it for time, please refer to microsofts advise: " To record a date or time, use a datetime2 data type.".
Thanks for the response, we're still developing, so I can to change to datetime2 as you suggest
I have a table that's got a
timestamp
column. Is there a way to read/write this? Should I use chrono for that?