Provider converts utc to local time, why??

Tommy
2012-02-16
2013-04-15
  • Tommy

    Tommy - 2012-02-16

    Hi,

    I have a big problem with datetime fields.
    If I write an entity to database having a datetime property set to DateTime.UtcNow the correct utc time will be in the database.
    But when I select this field from db using linq to entities I get a date that has already been converted back to local time.
    I need to get a utc datetime back from the db provider.
    In the connectionstring no DateTimeFormat is set, so iso8601 is used.

    What's the problem? 

    Best regards,
    cew3

     
  • Tommy

    Tommy - 2012-02-16

    There is a relatively new parameter DateTimeKind in the connection string that has to be set to "UTC"

    Many thanks to Joe Mistachkin from the sqlite-user mailing list
    http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks