{"action":"created","issue":{"url":"https://api.github.com/repos/dateutil/dateutil/issues/325","repository_url":"https://api.github.com/repos/dateutil/dateutil","labels_url":"https://api.github.com/repos/dateutil/dateutil/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/dateutil/dateutil/issues/325/comments","events_url":"https://api.github.com/repos/dateutil/dateutil/issues/325/events","html_url":"https://github.com/dateutil/dateutil/issues/325","id":191714009,"number":325,"title":"parser: default day is the 25th","user":{"login":"bpietropaoli","id":4210068,"avatar_url":"https://avatars.githubusercontent.com/u/4210068?v=3","gravatar_id":"","url":"https://api.github.com/users/bpietropaoli","html_url":"https://github.com/bpietropaoli","followers_url":"https://api.github.com/users/bpietropaoli/followers","following_url":"https://api.github.com/users/bpietropaoli/following{/other_user}","gists_url":"https://api.github.com/users/bpietropaoli/gists{/gist_id}","starred_url":"https://api.github.com/users/bpietropaoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bpietropaoli/subscriptions","organizations_url":"https://api.github.com/users/bpietropaoli/orgs","repos_url":"https://api.github.com/users/bpietropaoli/repos","events_url":"https://api.github.com/users/bpietropaoli/events{/privacy}","received_events_url":"https://api.github.com/users/bpietropaoli/received_events","type":"User","site_admin":false},"labels":[{"id":177049992,"url":"https://api.github.com/repos/dateutil/dateutil/labels/parser","name":"parser","color":"d4c5f9","default":false},{"id":149492531,"url":"https://api.github.com/repos/dateutil/dateutil/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-25T14:34:02Z","updated_at":"2016-11-25T15:08:29Z","closed_at":"2016-11-25T15:08:29Z","body":"```\r\n>>>import dateutil.parser\r\n>>>dateutil.parser.parse(\"2014-01\")\r\ndatetime.datetime(2014, 1, 25, 0, 0)\r\n>>>dateutil.parser.parse(\"2016-11\")\r\ndatetime.datetime(2016, 11, 25, 0, 0)\r\n```\r\n\r\nI had the same issue with both Python 2 and 3. The issue is observed with python-dateutil 2.6.0.\r\nStrangely, I remember having a similar behaviour in a previous version but with like the 8th instead of the 25th.\r\n\r\nMaybe it's just me but this behaviour seems rather odd. If I would create a date/datetime given this format (acceptable ISO8601), I would expect it to get the 1st of the month at midnight, not a random day."},"comment":{"url":"https://api.github.com/repos/dateutil/dateutil/issues/comments/262975314","html_url":"https://github.com/dateutil/dateutil/issues/325#issuecomment-262975314","issue_url":"https://api.github.com/repos/dateutil/dateutil/issues/325","id":262975314,"user":{"login":"pganssle","id":1377457,"avatar_url":"https://avatars.githubusercontent.com/u/1377457?v=3","gravatar_id":"","url":"https://api.github.com/users/pganssle","html_url":"https://github.com/pganssle","followers_url":"https://api.github.com/users/pganssle/followers","following_url":"https://api.github.com/users/pganssle/following{/other_user}","gists_url":"https://api.github.com/users/pganssle/gists{/gist_id}","starred_url":"https://api.github.com/users/pganssle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pganssle/subscriptions","organizations_url":"https://api.github.com/users/pganssle/orgs","repos_url":"https://api.github.com/users/pganssle/repos","events_url":"https://api.github.com/users/pganssle/events{/privacy}","received_events_url":"https://api.github.com/users/pganssle/received_events","type":"User","site_admin":false},"created_at":"2016-11-25T15:08:29Z","updated_at":"2016-11-25T15:08:29Z","body":"@bpietropaoli By default, the current day at midnight is used. I personally don't love this convention, but that's how the API works currently. I'm hoping to get an overhaul of the parser behavior in an upcoming release, and there should be a way to specify smarter defaults as part of that, but for now just change the `default` parameter to whatever you want, e.g:\r\n\r\n```python\r\nimport dateutil.parser\r\nfrom datetime import datetime\r\ndateutil.parser.parse(\"2014-02\", default=datetime(2016, 1, 1, 0, 0))\r\n# datetime.datetime(2014, 2, 1, 0, 0)\r\n```"}}
{"actor":{"display_login":"pganssle"}}