{"action":"created","issue":{"url":"https://api.github.com/repos/crsmithdev/arrow/issues/72","labels_url":"https://api.github.com/repos/crsmithdev/arrow/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/crsmithdev/arrow/issues/72/comments","events_url":"https://api.github.com/repos/crsmithdev/arrow/issues/72/events","html_url":"https://github.com/crsmithdev/arrow/issues/72","id":21888460,"number":72,"title":"Wrong result when a shift involves a DST change.","user":{"login":"ewjoachim","id":1457576,"avatar_url":"https://avatars.githubusercontent.com/u/1457576?v=3","gravatar_id":"","url":"https://api.github.com/users/ewjoachim","html_url":"https://github.com/ewjoachim","followers_url":"https://api.github.com/users/ewjoachim/followers","following_url":"https://api.github.com/users/ewjoachim/following{/other_user}","gists_url":"https://api.github.com/users/ewjoachim/gists{/gist_id}","starred_url":"https://api.github.com/users/ewjoachim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewjoachim/subscriptions","organizations_url":"https://api.github.com/users/ewjoachim/orgs","repos_url":"https://api.github.com/users/ewjoachim/repos","events_url":"https://api.github.com/users/ewjoachim/events{/privacy}","received_events_url":"https://api.github.com/users/ewjoachim/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/crsmithdev/arrow/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2013-10-31T10:48:22Z","updated_at":"2015-02-07T16:06:36Z","closed_at":null,"body":"In paris in 2013, we changed to DST in 2013-03-31 (at 2 AM it was 3 AM), from UTC+1 to UTC+2 (DST)\r\n\r\nHere's an example of the issue I have with arrow : \r\n\r\n```python\r\n>>> import arrow, datetime\r\n\r\n>>> just_before = arrow.get(datetime.datetime(2013, 03, 31, 1, 50, 45), \"Europe/Paris\").ceil(\"hour\")\r\n>>> just_before\r\n<Arrow [2013-03-31T01:59:59.999999+01:00]>\r\n\r\n>>> just_after = just_before.replace(microseconds=+1)\r\n>>> just_after\r\n<Arrow [2013-03-31T02:00:00+02:00]>\r\n>>> # That is not right... It should be either 2 AM UTC+1 or preferably  3AM UTC +2\r\n>>> # One could argue that depending on what you ask for, it may be the correct answer, but then the following is :\r\n\r\n>>> (just_after - just_before).total_seconds()\r\n1e-06\r\n>>> # That is right but not consistent with the dates\r\n\r\n>>> (just_after.to(\"utc\") - just_before.to(\"utc\").total_seconds()\r\n-3599.999999\r\n# That should be the same value as the previous computation. Plus, the value is negative because :\r\n\r\n>>> just_before.to('utc'), just_after.to('utc')\r\n(<Arrow [2013-03-31T00:59:59.999999+00:00]>,\r\n <Arrow [2013-03-31T00:00:00+00:00]>)\r\n ```\r\n\r\nI think the problem is pretty clear..."},"comment":{"url":"https://api.github.com/repos/crsmithdev/arrow/issues/comments/73370105","html_url":"https://github.com/crsmithdev/arrow/issues/72#issuecomment-73370105","issue_url":"https://api.github.com/repos/crsmithdev/arrow/issues/72","id":73370105,"user":{"login":"ewjoachim","id":1457576,"avatar_url":"https://avatars.githubusercontent.com/u/1457576?v=3","gravatar_id":"","url":"https://api.github.com/users/ewjoachim","html_url":"https://github.com/ewjoachim","followers_url":"https://api.github.com/users/ewjoachim/followers","following_url":"https://api.github.com/users/ewjoachim/following{/other_user}","gists_url":"https://api.github.com/users/ewjoachim/gists{/gist_id}","starred_url":"https://api.github.com/users/ewjoachim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ewjoachim/subscriptions","organizations_url":"https://api.github.com/users/ewjoachim/orgs","repos_url":"https://api.github.com/users/ewjoachim/repos","events_url":"https://api.github.com/users/ewjoachim/events{/privacy}","received_events_url":"https://api.github.com/users/ewjoachim/received_events","type":"User","site_admin":false},"created_at":"2015-02-07T16:06:36Z","updated_at":"2015-02-07T16:06:36Z","body":"@chebee7i I don't think so. When you're on 2013-03-30 12:00:00+01:00, in Paris and you you want \"1 day later\", if you shift to UTC, you'll get 2013-03-30 11:00:00Z, add 1 day that's 2013-03-30 11:00:00Z, shift back to Paris, it's 2013-03-30 13:00:00+02:00.\r\n\r\nGoing to UTC is \"useless\" in this case, it's just like considering \"1 day equals 24 hours, period.\" and that's the heart of the problem. Everything under the day (second, minute, hour) works like that (well except with leap seconds but that's something else) and everything from the day and up, what you need (most  of the time, or at least what I do need) is not a time shift but a calendar digits replace."}}