{"action":"created","comment":{"url":"https://api.github.com/repos/JetBrains/ktor/pulls/comments/38012495","id":38012495,"diff_hunk":"@@ -1,18 +1,17 @@\n package org.jetbrains.ktor.http\n \n-import java.text.*\n+import java.time.*\n+import java.time.format.*\n+import java.time.temporal.*\n import java.util.*\n \n-fun Long.toHttpDateString(): String {\n-    val calendar = Calendar.getInstance();\n-    calendar.setTimeInMillis(this)\n-    val dateFormat = SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", Locale.US);\n-    dateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n-    return dateFormat.format(calendar.getTime());\n-}\n+fun Long.toHttpDateString(): String = Instant.ofEpochMilli(this).toHttpDateString()\n+fun Temporal.toHttpDateString(): String = httpDateFormat.format(this)\n \n-fun String.fromHttpDateString(): Long {\n-    val dateFormat = SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", Locale.US);\n-    dateFormat.setTimeZone(TimeZone.getTimeZone(\"GMT\"));\n-    return dateFormat.parse(this).getTime()\n-}\n\\ No newline at end of file\n+fun String.fromHttpDateString(): ZonedDateTime = ZonedDateTime.parse(this, httpDateFormat)\n+\n+val httpDateFormat: DateTimeFormatter\n+    get() = DateTimeFormatter","path":"ktor-core/src/org/jetbrains/ktor/http/Dates.kt","position":null,"original_position":28,"commit_id":"b83ae6584d3cb0782360edcfbfaf6e01f4c6ad45","original_commit_id":"7848b64fc4250d01ec523b4f6e91de450fba712e","user":{"login":"cy6erGn0m","id":762598,"avatar_url":"https://avatars.githubusercontent.com/u/762598?v=3","gravatar_id":"","url":"https://api.github.com/users/cy6erGn0m","html_url":"https://github.com/cy6erGn0m","followers_url":"https://api.github.com/users/cy6erGn0m/followers","following_url":"https://api.github.com/users/cy6erGn0m/following{/other_user}","gists_url":"https://api.github.com/users/cy6erGn0m/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erGn0m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erGn0m/subscriptions","organizations_url":"https://api.github.com/users/cy6erGn0m/orgs","repos_url":"https://api.github.com/users/cy6erGn0m/repos","events_url":"https://api.github.com/users/cy6erGn0m/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erGn0m/received_events","type":"User","site_admin":false},"body":"fixed","created_at":"2015-08-26T17:51:01Z","updated_at":"2015-08-26T17:51:01Z","html_url":"https://github.com/JetBrains/ktor/pull/3#discussion_r38012495","pull_request_url":"https://api.github.com/repos/JetBrains/ktor/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/JetBrains/ktor/pulls/comments/38012495"},"html":{"href":"https://github.com/JetBrains/ktor/pull/3#discussion_r38012495"},"pull_request":{"href":"https://api.github.com/repos/JetBrains/ktor/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/JetBrains/ktor/pulls/3","id":43321088,"html_url":"https://github.com/JetBrains/ktor/pull/3","diff_url":"https://github.com/JetBrains/ktor/pull/3.diff","patch_url":"https://github.com/JetBrains/ktor/pull/3.patch","issue_url":"https://api.github.com/repos/JetBrains/ktor/issues/3","number":3,"state":"open","locked":false,"title":"Dates and attributes","user":{"login":"cy6erGn0m","id":762598,"avatar_url":"https://avatars.githubusercontent.com/u/762598?v=3","gravatar_id":"","url":"https://api.github.com/users/cy6erGn0m","html_url":"https://github.com/cy6erGn0m","followers_url":"https://api.github.com/users/cy6erGn0m/followers","following_url":"https://api.github.com/users/cy6erGn0m/following{/other_user}","gists_url":"https://api.github.com/users/cy6erGn0m/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erGn0m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erGn0m/subscriptions","organizations_url":"https://api.github.com/users/cy6erGn0m/orgs","repos_url":"https://api.github.com/users/cy6erGn0m/repos","events_url":"https://api.github.com/users/cy6erGn0m/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erGn0m/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-25T18:40:42Z","updated_at":"2015-08-26T17:51:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db22242cd7a75d6befd307e2a9e94cfccc59cd29","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JetBrains/ktor/pulls/3/commits","review_comments_url":"https://api.github.com/repos/JetBrains/ktor/pulls/3/comments","review_comment_url":"https://api.github.com/repos/JetBrains/ktor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JetBrains/ktor/issues/3/comments","statuses_url":"https://api.github.com/repos/JetBrains/ktor/statuses/b83ae6584d3cb0782360edcfbfaf6e01f4c6ad45","head":{"label":"cy6erGn0m:dates-and-attributes","ref":"dates-and-attributes","sha":"b83ae6584d3cb0782360edcfbfaf6e01f4c6ad45","user":{"login":"cy6erGn0m","id":762598,"avatar_url":"https://avatars.githubusercontent.com/u/762598?v=3","gravatar_id":"","url":"https://api.github.com/users/cy6erGn0m","html_url":"https://github.com/cy6erGn0m","followers_url":"https://api.github.com/users/cy6erGn0m/followers","following_url":"https://api.github.com/users/cy6erGn0m/following{/other_user}","gists_url":"https://api.github.com/users/cy6erGn0m/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erGn0m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erGn0m/subscriptions","organizations_url":"https://api.github.com/users/cy6erGn0m/orgs","repos_url":"https://api.github.com/users/cy6erGn0m/repos","events_url":"https://api.github.com/users/cy6erGn0m/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erGn0m/received_events","type":"User","site_admin":false},"repo":{"id":40906748,"name":"ktor","full_name":"cy6erGn0m/ktor","owner":{"login":"cy6erGn0m","id":762598,"avatar_url":"https://avatars.githubusercontent.com/u/762598?v=3","gravatar_id":"","url":"https://api.github.com/users/cy6erGn0m","html_url":"https://github.com/cy6erGn0m","followers_url":"https://api.github.com/users/cy6erGn0m/followers","following_url":"https://api.github.com/users/cy6erGn0m/following{/other_user}","gists_url":"https://api.github.com/users/cy6erGn0m/gists{/gist_id}","starred_url":"https://api.github.com/users/cy6erGn0m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cy6erGn0m/subscriptions","organizations_url":"https://api.github.com/users/cy6erGn0m/orgs","repos_url":"https://api.github.com/users/cy6erGn0m/repos","events_url":"https://api.github.com/users/cy6erGn0m/events{/privacy}","received_events_url":"https://api.github.com/users/cy6erGn0m/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cy6erGn0m/ktor","description":"Web backend framework for Kotlin","fork":true,"url":"https://api.github.com/repos/cy6erGn0m/ktor","forks_url":"https://api.github.com/repos/cy6erGn0m/ktor/forks","keys_url":"https://api.github.com/repos/cy6erGn0m/ktor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cy6erGn0m/ktor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cy6erGn0m/ktor/teams","hooks_url":"https://api.github.com/repos/cy6erGn0m/ktor/hooks","issue_events_url":"https://api.github.com/repos/cy6erGn0m/ktor/issues/events{/number}","events_url":"https://api.github.com/repos/cy6erGn0m/ktor/events","assignees_url":"https://api.github.com/repos/cy6erGn0m/ktor/assignees{/user}","branches_url":"https://api.github.com/repos/cy6erGn0m/ktor/branches{/branch}","tags_url":"https://api.github.com/repos/cy6erGn0m/ktor/tags","blobs_url":"https://api.github.com/repos/cy6erGn0m/ktor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cy6erGn0m/ktor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cy6erGn0m/ktor/git/refs{/sha}","trees_url":"https://api.github.com/repos/cy6erGn0m/ktor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cy6erGn0m/ktor/statuses/{sha}","languages_url":"https://api.github.com/repos/cy6erGn0m/ktor/languages","stargazers_url":"https://api.github.com/repos/cy6erGn0m/ktor/stargazers","contributors_url":"https://api.github.com/repos/cy6erGn0m/ktor/contributors","subscribers_url":"https://api.github.com/repos/cy6erGn0m/ktor/subscribers","subscription_url":"https://api.github.com/repos/cy6erGn0m/ktor/subscription","commits_url":"https://api.github.com/repos/cy6erGn0m/ktor/commits{/sha}","git_commits_url":"https://api.github.com/repos/cy6erGn0m/ktor/git/commits{/sha}","comments_url":"https://api.github.com/repos/cy6erGn0m/ktor/comments{/number}","issue_comment_url":"https://api.github.com/repos/cy6erGn0m/ktor/issues/comments{/number}","contents_url":"https://api.github.com/repos/cy6erGn0m/ktor/contents/{+path}","compare_url":"https://api.github.com/repos/cy6erGn0m/ktor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cy6erGn0m/ktor/merges","archive_url":"https://api.github.com/repos/cy6erGn0m/ktor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cy6erGn0m/ktor/downloads","issues_url":"https://api.github.com/repos/cy6erGn0m/ktor/issues{/number}","pulls_url":"https://api.github.com/repos/cy6erGn0m/ktor/pulls{/number}","milestones_url":"https://api.github.com/repos/cy6erGn0m/ktor/milestones{/number}","notifications_url":"https://api.github.com/repos/cy6erGn0m/ktor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cy6erGn0m/ktor/labels{/name}","releases_url":"https://api.github.com/repos/cy6erGn0m/ktor/releases{/id}","created_at":"2015-08-17T15:40:03Z","updated_at":"2015-08-17T15:40:04Z","pushed_at":"2015-08-26T17:50:43Z","git_url":"git://github.com/cy6erGn0m/ktor.git","ssh_url":"git@github.com:cy6erGn0m/ktor.git","clone_url":"https://github.com/cy6erGn0m/ktor.git","svn_url":"https://github.com/cy6erGn0m/ktor","homepage":"","size":483,"stargazers_count":0,"watchers_count":0,"language":"Kotlin","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JetBrains:master","ref":"master","sha":"5813dfab08a4fd763269af27100486d203071684","user":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars.githubusercontent.com/u/878437?v=3","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"repo":{"id":40136600,"name":"ktor","full_name":"JetBrains/ktor","owner":{"login":"JetBrains","id":878437,"avatar_url":"https://avatars.githubusercontent.com/u/878437?v=3","gravatar_id":"","url":"https://api.github.com/users/JetBrains","html_url":"https://github.com/JetBrains","followers_url":"https://api.github.com/users/JetBrains/followers","following_url":"https://api.github.com/users/JetBrains/following{/other_user}","gists_url":"https://api.github.com/users/JetBrains/gists{/gist_id}","starred_url":"https://api.github.com/users/JetBrains/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JetBrains/subscriptions","organizations_url":"https://api.github.com/users/JetBrains/orgs","repos_url":"https://api.github.com/users/JetBrains/repos","events_url":"https://api.github.com/users/JetBrains/events{/privacy}","received_events_url":"https://api.github.com/users/JetBrains/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JetBrains/ktor","description":"Web backend framework for Kotlin","fork":false,"url":"https://api.github.com/repos/JetBrains/ktor","forks_url":"https://api.github.com/repos/JetBrains/ktor/forks","keys_url":"https://api.github.com/repos/JetBrains/ktor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JetBrains/ktor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JetBrains/ktor/teams","hooks_url":"https://api.github.com/repos/JetBrains/ktor/hooks","issue_events_url":"https://api.github.com/repos/JetBrains/ktor/issues/events{/number}","events_url":"https://api.github.com/repos/JetBrains/ktor/events","assignees_url":"https://api.github.com/repos/JetBrains/ktor/assignees{/user}","branches_url":"https://api.github.com/repos/JetBrains/ktor/branches{/branch}","tags_url":"https://api.github.com/repos/JetBrains/ktor/tags","blobs_url":"https://api.github.com/repos/JetBrains/ktor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JetBrains/ktor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JetBrains/ktor/git/refs{/sha}","trees_url":"https://api.github.com/repos/JetBrains/ktor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JetBrains/ktor/statuses/{sha}","languages_url":"https://api.github.com/repos/JetBrains/ktor/languages","stargazers_url":"https://api.github.com/repos/JetBrains/ktor/stargazers","contributors_url":"https://api.github.com/repos/JetBrains/ktor/contributors","subscribers_url":"https://api.github.com/repos/JetBrains/ktor/subscribers","subscription_url":"https://api.github.com/repos/JetBrains/ktor/subscription","commits_url":"https://api.github.com/repos/JetBrains/ktor/commits{/sha}","git_commits_url":"https://api.github.com/repos/JetBrains/ktor/git/commits{/sha}","comments_url":"https://api.github.com/repos/JetBrains/ktor/comments{/number}","issue_comment_url":"https://api.github.com/repos/JetBrains/ktor/issues/comments{/number}","contents_url":"https://api.github.com/repos/JetBrains/ktor/contents/{+path}","compare_url":"https://api.github.com/repos/JetBrains/ktor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JetBrains/ktor/merges","archive_url":"https://api.github.com/repos/JetBrains/ktor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JetBrains/ktor/downloads","issues_url":"https://api.github.com/repos/JetBrains/ktor/issues{/number}","pulls_url":"https://api.github.com/repos/JetBrains/ktor/pulls{/number}","milestones_url":"https://api.github.com/repos/JetBrains/ktor/milestones{/number}","notifications_url":"https://api.github.com/repos/JetBrains/ktor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JetBrains/ktor/labels{/name}","releases_url":"https://api.github.com/repos/JetBrains/ktor/releases{/id}","created_at":"2015-08-03T16:49:36Z","updated_at":"2015-08-22T13:48:42Z","pushed_at":"2015-08-26T17:50:43Z","git_url":"git://github.com/JetBrains/ktor.git","ssh_url":"git@github.com:JetBrains/ktor.git","clone_url":"https://github.com/JetBrains/ktor.git","svn_url":"https://github.com/JetBrains/ktor","homepage":"","size":520,"stargazers_count":2,"watchers_count":2,"language":"Kotlin","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JetBrains/ktor/pulls/3"},"html":{"href":"https://github.com/JetBrains/ktor/pull/3"},"issue":{"href":"https://api.github.com/repos/JetBrains/ktor/issues/3"},"comments":{"href":"https://api.github.com/repos/JetBrains/ktor/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/JetBrains/ktor/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/JetBrains/ktor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JetBrains/ktor/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/JetBrains/ktor/statuses/b83ae6584d3cb0782360edcfbfaf6e01f4c6ad45"}}}}