{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/886","labels_url":"https://api.github.com/repos/npgsql/npgsql/issues/886/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/npgsql/issues/886/comments","events_url":"https://api.github.com/repos/npgsql/npgsql/issues/886/events","html_url":"https://github.com/npgsql/npgsql/issues/886","id":119222173,"number":886,"title":"UTC DateTime Not Inserted into Database As Is","user":{"login":"shortspider","id":5712543,"avatar_url":"https://avatars.githubusercontent.com/u/5712543?v=3","gravatar_id":"","url":"https://api.github.com/users/shortspider","html_url":"https://github.com/shortspider","followers_url":"https://api.github.com/users/shortspider/followers","following_url":"https://api.github.com/users/shortspider/following{/other_user}","gists_url":"https://api.github.com/users/shortspider/gists{/gist_id}","starred_url":"https://api.github.com/users/shortspider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shortspider/subscriptions","organizations_url":"https://api.github.com/users/shortspider/orgs","repos_url":"https://api.github.com/users/shortspider/repos","events_url":"https://api.github.com/users/shortspider/events{/privacy}","received_events_url":"https://api.github.com/users/shortspider/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-27T16:38:00Z","updated_at":"2015-11-30T21:22:25Z","closed_at":null,"body":"I am in the process of updating Npgsql from 2.2.5 to 3.0 and I am seeing some odd behaviour with DateTimes.\r\n\r\nIf I take a DateTime that has its kind set to UTC and create a NpgsqlParameter with it (just specifying the name and value) the parameter has a DbType of DateTime and a NpgsqlDbType of Timestamp. Going by [this page](http://www.npgsql.org/doc/datetime.html) the DateTime should be sent to the database as is. However, the DateTimes in the database are all converted to local time.\r\n\r\nFor example, if I create a DateTime of 2-3-2015 00:00:00 with kind UTC when it is added to the database it becomes 1-3-2015 19:00:00 (I'm in the Eastern Time Zone).\r\n\r\nIf I set the DbType to DateTime2 this does not happen and the value is inserted as expected.\r\n\r\nIs this a bug or am I missing something?\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/npgsql/npgsql/issues/comments/160765629","html_url":"https://github.com/npgsql/npgsql/issues/886#issuecomment-160765629","issue_url":"https://api.github.com/repos/npgsql/npgsql/issues/886","id":160765629,"user":{"login":"Emill","id":1660778,"avatar_url":"https://avatars.githubusercontent.com/u/1660778?v=3","gravatar_id":"","url":"https://api.github.com/users/Emill","html_url":"https://github.com/Emill","followers_url":"https://api.github.com/users/Emill/followers","following_url":"https://api.github.com/users/Emill/following{/other_user}","gists_url":"https://api.github.com/users/Emill/gists{/gist_id}","starred_url":"https://api.github.com/users/Emill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Emill/subscriptions","organizations_url":"https://api.github.com/users/Emill/orgs","repos_url":"https://api.github.com/users/Emill/repos","events_url":"https://api.github.com/users/Emill/events{/privacy}","received_events_url":"https://api.github.com/users/Emill/received_events","type":"User","site_admin":false},"created_at":"2015-11-30T21:22:25Z","updated_at":"2015-11-30T21:22:25Z","body":"The rules in PostgreSQL is that when you convert/cast a timestamp with time zone to a timestamp without time zone, it converts the value to local time zone."}}