Provider converts utc to local time, why??

  • Tommy

    Tommy - 2012-02-16


    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,

  • 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


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