{"action":"closed","issue":{"url":"https://api.github.com/repos/facebook/presto/issues/2590","labels_url":"https://api.github.com/repos/facebook/presto/issues/2590/labels{/name}","comments_url":"https://api.github.com/repos/facebook/presto/issues/2590/comments","events_url":"https://api.github.com/repos/facebook/presto/issues/2590/events","html_url":"https://github.com/facebook/presto/issues/2590","id":64205104,"number":2590,"title":"Specifier '%f' in Date Function is broken","user":{"login":"hikoz","id":56118,"avatar_url":"https://avatars.githubusercontent.com/u/56118?v=3","gravatar_id":"","url":"https://api.github.com/users/hikoz","html_url":"https://github.com/hikoz","followers_url":"https://api.github.com/users/hikoz/followers","following_url":"https://api.github.com/users/hikoz/following{/other_user}","gists_url":"https://api.github.com/users/hikoz/gists{/gist_id}","starred_url":"https://api.github.com/users/hikoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hikoz/subscriptions","organizations_url":"https://api.github.com/users/hikoz/orgs","repos_url":"https://api.github.com/users/hikoz/repos","events_url":"https://api.github.com/users/hikoz/events{/privacy}","received_events_url":"https://api.github.com/users/hikoz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"haozhun","id":2020503,"avatar_url":"https://avatars.githubusercontent.com/u/2020503?v=3","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/facebook/presto/milestones/9","html_url":"https://github.com/facebook/presto/milestones/0.100","labels_url":"https://api.github.com/repos/facebook/presto/milestones/9/labels","id":1045223,"number":9,"title":"0.100","description":"","creator":{"login":"dain","id":58298,"avatar_url":"https://avatars.githubusercontent.com/u/58298?v=3","gravatar_id":"","url":"https://api.github.com/users/dain","html_url":"https://github.com/dain","followers_url":"https://api.github.com/users/dain/followers","following_url":"https://api.github.com/users/dain/following{/other_user}","gists_url":"https://api.github.com/users/dain/gists{/gist_id}","starred_url":"https://api.github.com/users/dain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dain/subscriptions","organizations_url":"https://api.github.com/users/dain/orgs","repos_url":"https://api.github.com/users/dain/repos","events_url":"https://api.github.com/users/dain/events{/privacy}","received_events_url":"https://api.github.com/users/dain/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2015-03-30T17:16:08Z","updated_at":"2015-03-30T17:17:33Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-03-25T07:50:41Z","updated_at":"2015-03-30T17:17:33Z","closed_at":"2015-03-30T17:17:33Z","body":"Specifier '%f' in Date Function acts as Milliseconds in date_parse,\r\nMicroseconds in date_format.\r\nAnd not working properly in both way.\r\n\r\nWritten Microseconds in the Manual.\r\nhttps://prestodb.io/docs/0.98/functions/datetime.html#mysql-date-functions\r\n\r\nImplemented as Milliseconds with 6 digits in source code.\r\nhttps://github.com/facebook/presto/blob/0.99/presto-main/src/main/java/com/facebook/presto/operator/scalar/DateTimeFunctions.java#L879\r\n\r\n```sql\r\n> select date_format(TIMESTAMP '2015-03-04 05:06:07.8', '%s.%f');\r\n 07.000800\r\n; expects 07.800000\r\n\r\n> select date_parse('1.1', '%s.%f');\r\n 1970-01-01 00:00:01.001\r\n; expects 1970-01-01 00:00:01.100000\r\n\r\n> select date_parse('1.01', '%s.%f');\r\n 1970-01-01 00:00:01.001\r\n; expects 1970-01-01 00:00:01.010000\r\n\r\n> select date_parse('1.1001', '%s.%f');\r\nQuery 20150325_073341_00262_4nhqg failed: Cannot parse \"1.1001\": Value 1001 for millisOfSecond must be in the range [0,999]\r\n; expects 1970-01-01 00:00:01.100100\r\n```"}}