{"action":"created","issue":{"url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/184","repository_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils","labels_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/184/comments","events_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/184/events","html_url":"https://github.com/kvesteri/sqlalchemy-utils/issues/184","id":129086709,"number":184,"title":"EncryptedType with date time and timezone","user":{"login":"jssuzanne","id":5787689,"avatar_url":"https://avatars.githubusercontent.com/u/5787689?v=3","gravatar_id":"","url":"https://api.github.com/users/jssuzanne","html_url":"https://github.com/jssuzanne","followers_url":"https://api.github.com/users/jssuzanne/followers","following_url":"https://api.github.com/users/jssuzanne/following{/other_user}","gists_url":"https://api.github.com/users/jssuzanne/gists{/gist_id}","starred_url":"https://api.github.com/users/jssuzanne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jssuzanne/subscriptions","organizations_url":"https://api.github.com/users/jssuzanne/orgs","repos_url":"https://api.github.com/users/jssuzanne/repos","events_url":"https://api.github.com/users/jssuzanne/events{/privacy}","received_events_url":"https://api.github.com/users/jssuzanne/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-01-27T09:41:36Z","updated_at":"2016-07-08T19:49:23Z","closed_at":null,"body":"Hi,\r\n\r\nAt https://github.com/kvesteri/sqlalchemy-utils/blob/master/sqlalchemy_utils/types/encrypted.py#L253, the date time is formatted with isoformat. Iso format convert the date time to str with microsecond and timezone.\r\n\r\nAt https://github.com/kvesteri/sqlalchemy-utils/blob/master/sqlalchemy_utils/types/encrypted.py#L278,\r\nthe formater does not take microsecond and timezone.\r\n\r\nIt is not really a bug, but the encrypted date time can not be other than a naive date time. I understand that convert all date time format is difficult, why does not use python-dateutils to convert str 2 date time, or regex."},"comment":{"url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/comments/231455625","html_url":"https://github.com/kvesteri/sqlalchemy-utils/issues/184#issuecomment-231455625","issue_url":"https://api.github.com/repos/kvesteri/sqlalchemy-utils/issues/184","id":231455625,"user":{"login":"nosarcasm","id":1616888,"avatar_url":"https://avatars.githubusercontent.com/u/1616888?v=3","gravatar_id":"","url":"https://api.github.com/users/nosarcasm","html_url":"https://github.com/nosarcasm","followers_url":"https://api.github.com/users/nosarcasm/followers","following_url":"https://api.github.com/users/nosarcasm/following{/other_user}","gists_url":"https://api.github.com/users/nosarcasm/gists{/gist_id}","starred_url":"https://api.github.com/users/nosarcasm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nosarcasm/subscriptions","organizations_url":"https://api.github.com/users/nosarcasm/orgs","repos_url":"https://api.github.com/users/nosarcasm/repos","events_url":"https://api.github.com/users/nosarcasm/events{/privacy}","received_events_url":"https://api.github.com/users/nosarcasm/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T19:49:23Z","updated_at":"2016-07-08T19:49:23Z","body":"Have the same issue, changed https://github.com/kvesteri/sqlalchemy-utils/blob/master/sqlalchemy_utils/types/encrypted.py#L278 to this as a hacky fix:\r\n\r\n```\r\ndecrypted_value.split(\".\")[0], '%Y-%m-%dT%H:%M:%S'\r\n```\r\n"}}
{"actor":{"display_login":"nosarcasm"}}