View Ticket
Not logged in
Ticket UUID: 84cf1f49175420bb22dc2a848d1210a515f450a3
Title: Please add support for DateTimeOffset
Status: Open Type: Feature_Request
Severity: Minor Priority: Low
Subsystem: Db_Type_Conversion Resolution: Open
Last Modified: 2018-01-24 19:56:04
Version Found In:
It would be nice if System.Data.SQLite had support for DbType.DateTimeOffset.

I think that it would have to store them as strings, since you can't pack a DateTimeOffset into a 64 bit int (it needs 64+16 AFAICT).

User Comments:
anonymous added on 2014-10-24 15:03:36:
Please consider implementing this feature.  It has great value in unit testing with ORMs.  If it is difficult, please remark.  (It's been three years!)

mistachkin added on 2014-10-28 19:03:22:
So, to clarify, what is being asked for here is the ability for the core
System.Data.SQLite assembly to provide "automatic" data type conversion
and read/write support (i.e. via SQLiteDataReader and SQLiteParameter)?

anonymous added on 2014-11-26 18:02:11:
@mistachkin: Based on the OP's request, I think he was looking for it to be a recognized data type, probably with date function support.  That sounds like it's beyond the scope of System.Data.SQLite, but I'm not sure.  My guess is that even simple comparison functions become not-so-simple with offsets.  As you say, automatic conversion of the type would satisfy my needs.

mistachkin added on 2018-01-24 19:56:04:
Also see ticket [a799e3978f].  Using a custom type mapping may work.