jeudi 18 février 2016

SQLite.Net-PCL - save the datetime error(-2 hours)

I created app for Windows Phone. I used SQLite.Net.Async-PCL 3.0.5. It is code from my repository

 SQLiteAsyncConnection _db;     
 .......
 var connectionFactory = new Func<SQLiteConnectionWithLock>
                (() => new SQLiteConnectionWithLock(param.Platform, new SQLiteConnectionString(param.Path, false)));
 _db = new SQLiteAsyncConnection(connectionFactory); 

It is my domain class History

public class History()
{
   public DateTime DtStart {get;set;}
   public DateTime DtEnd {get;set;}
}

I have updated the package to version 3.1.1 and got an error. When I save or change the values of field DtStart or DtEnd is reduced by two hours. It is example:

var h = new History
{
   DtStart = new DateTime(2016, 1, 1, 8, 0, 0);
   DtEnd = new DateTime(2016, 1, 1, 8, 30, 0); 
}

//saved to db
....

When I select this item from database :

h.DtStart ="2016-1-1 6:00"

h.DtEnd ="2016-1-1 6:30"

Decreased value for two hours. My time zone is UTC+2 :). How do I fix this?

Aucun commentaire:

Enregistrer un commentaire