Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

DateTime data type and retrieving records in SQLite

$
0
0

I am having a problem pulling records from my Sqlite db by date.
Here is my model:

public class exerciseTbl
{
[PrimaryKey]
public int exerciseID { get; set; }
public string exerciseName { get; set; }
public DateTime exerciseDate { get; set; }
}

Most of the records just use date.today when inserting. When I insert records, it looks like: 2019-04-09T00:00:00.000. When I try to do a query using date.today, I don't get any records. I have read that I should store datetimes as strings (I am not using ticks) but the model would not correctly represent the data and would make migration to a different database platform a pain. There are many examples but all of them use actual strings instead of date.today or date.now. If anyone can offer any advice on how to accomplish this I would appreciate it.
Thank you,
Rob


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>