J
Jeff0803
Guest
In the Access DB, there's a date field and I save date-only.
In case of date is 7/10/2020, it is save as (7/10/2020 12:00:00 AM) in the DB.
If read it to t1 and calculate day diff between now, it returns wrong result.
Here is the code.
TimeSpan difference;
t1 = GetDateFromDB();//this is a method that read date from DB and checked it returns 7/10/2020 12:00:00 AM correctly
difference = t1.Date - DateTime.Now.Date;
MessageBox.Show(difference.Days.ToString())
Result is -737588.
Can anybody give me some advice?
Continue reading...
In case of date is 7/10/2020, it is save as (7/10/2020 12:00:00 AM) in the DB.
If read it to t1 and calculate day diff between now, it returns wrong result.
Here is the code.
TimeSpan difference;
t1 = GetDateFromDB();//this is a method that read date from DB and checked it returns 7/10/2020 12:00:00 AM correctly
difference = t1.Date - DateTime.Now.Date;
MessageBox.Show(difference.Days.ToString())
Result is -737588.
Can anybody give me some advice?
Continue reading...