{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/4681","repository_url":"https://api.github.com/repos/elixir-lang/elixir","labels_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4681/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4681/comments","events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4681/events","html_url":"https://github.com/elixir-lang/elixir/issues/4681","id":156577882,"number":4681,"title":"Microsecond defaults","user":{"login":"lau","id":12623,"avatar_url":"https://avatars.githubusercontent.com/u/12623?v=3","gravatar_id":"","url":"https://api.github.com/users/lau","html_url":"https://github.com/lau","followers_url":"https://api.github.com/users/lau/followers","following_url":"https://api.github.com/users/lau/following{/other_user}","gists_url":"https://api.github.com/users/lau/gists{/gist_id}","starred_url":"https://api.github.com/users/lau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lau/subscriptions","organizations_url":"https://api.github.com/users/lau/orgs","repos_url":"https://api.github.com/users/lau/repos","events_url":"https://api.github.com/users/lau/events{/privacy}","received_events_url":"https://api.github.com/users/lau/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/App:Elixir","name":"App:Elixir","color":"CCCCCC"},{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Kind:Enhancement","name":"Kind:Enhancement","color":"009800"},{"url":"https://api.github.com/repos/elixir-lang/elixir/labels/Level:Advanced","name":"Level:Advanced","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/elixir-lang/elixir/milestones/17","html_url":"https://github.com/elixir-lang/elixir/milestones/v1.3.0","labels_url":"https://api.github.com/repos/elixir-lang/elixir/milestones/17/labels","id":1442016,"number":17,"title":"v1.3.0","description":"","creator":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"open_issues":9,"closed_issues":37,"state":"open","created_at":"2015-12-03T12:25:01Z","updated_at":"2016-05-25T15:21:33Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2016-05-24T18:31:21Z","updated_at":"2016-05-25T16:41:42Z","closed_at":null,"body":"Shouldn't microsecond default to nil instead of 0? For Time, NaiveDateTime and DateTime.\r\n\r\nExample: `{10, 30, 22} |> Time.from_erl! |> Map.get(:microsecond)`\r\nWouldn’t it make more sense if microsecond was nil instead of 0 here? We don’t know anything about microseconds from the data provided.\r\n\r\nAnother example: We parse some datetimes.\r\n\r\n`2015-01-23T23:50:07.123` microsecond: 123000\r\n`2015-01-23T23:50:07.0` microsecond: 0\r\n`2015-01-23T23:50:07` microsecond: ?\r\n\r\nI propose that the third datetime should have “microsecond” be nil and not 0. Because we don’t know anything about microsecond precision.\r\n\r\nWith defaulting to 0 the 2nd and 3rd datetime would be identical and if we format the datetimes again the difference in precision would be lost. By defaulting to 0 we cannot reproduce the ISO 8601 datetime strings because we threw away the microsecond information provided. But if nil was allowed and the default, we could save that information."},"comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments/221634535","html_url":"https://github.com/elixir-lang/elixir/issues/4681#issuecomment-221634535","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/4681","id":221634535,"user":{"login":"lau","id":12623,"avatar_url":"https://avatars.githubusercontent.com/u/12623?v=3","gravatar_id":"","url":"https://api.github.com/users/lau","html_url":"https://github.com/lau","followers_url":"https://api.github.com/users/lau/followers","following_url":"https://api.github.com/users/lau/following{/other_user}","gists_url":"https://api.github.com/users/lau/gists{/gist_id}","starred_url":"https://api.github.com/users/lau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lau/subscriptions","organizations_url":"https://api.github.com/users/lau/orgs","repos_url":"https://api.github.com/users/lau/repos","events_url":"https://api.github.com/users/lau/events{/privacy}","received_events_url":"https://api.github.com/users/lau/received_events","type":"User","site_admin":false},"created_at":"2016-05-25T16:41:42Z","updated_at":"2016-05-25T16:41:42Z","body":"> To clarify:\r\n> \r\n> ```\r\n> iex> ~T[08:00:00].microseconds\r\n> {0, 0}\r\n> \r\n> iex> ~T[08:00:00.0].microseconds\r\n> {0, 1}\r\n> \r\n> iex> ~T[08:00:00.01].microseconds\r\n> {10000, 2}\r\n> \r\n> iex> ~T[08:00:00.123456].microseconds\r\n> {123456, 6}\r\n> ```\r\n> \r\n\r\nI like the idea.\r\n\r\nWouldn't {nil, 0} for the first example be more correct?"}}
{"actor":{"display_login":"lau"}}