{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/143230884","pull_request_review_id":67717192,"id":143230884,"diff_hunk":"@@ -966,8 +969,32 @@ internal static String Format(DateTime dateTime, String format, DateTimeFormatIn\n             return Format(dateTime, format, dtfi, NullOffset);\n         }\n \n+        internal static string Format(DateTime dateTime, String format, DateTimeFormatInfo dtfi, TimeSpan offset) =>\n+            StringBuilderCache.GetStringAndRelease(FormatStringBuilder(dateTime, format, dtfi, offset));\n \n-        internal static String Format(DateTime dateTime, String format, DateTimeFormatInfo dtfi, TimeSpan offset)\n+        internal static bool TryFormat(DateTime dateTime, Span<char> destination, out int charsWritten, string format, DateTimeFormatInfo dtfi) =>\n+            TryFormat(dateTime, destination, out charsWritten, format, dtfi, NullOffset);\n+\n+        internal static bool TryFormat(DateTime dateTime, Span<char> destination, out int charsWritten, string format, DateTimeFormatInfo dtfi, TimeSpan offset)\n+        {\n+            StringBuilder sb = FormatStringBuilder(dateTime, format, dtfi, offset);\n+\n+            bool success = sb.Length <= destination.Length;\n+            if (success)\n+            {\n+                sb.CopyTo(0, destination, sb.Length);\n+                charsWritten = sb.Length;\n+            }\n+            else\n+            {\n+                charsWritten = 0;\n+            }\n+\n+            StringBuilderCache.Release(sb);","path":"src/mscorlib/shared/System/Globalization/DateTimeFormat.cs","position":68,"original_position":68,"commit_id":"e4533291b47ff4292bed37dd18d1e4d4658e0cf1","original_commit_id":"e4533291b47ff4292bed37dd18d1e4d4658e0cf1","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars0.githubusercontent.com/u/2642209?v=4","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"> did we release this here and not in FormatStringBuilder because of perf?\r\n\r\nNo, because it's used by two different callers that need the StringBuilder to do different things with it: one calls ToString to get the results as a string, the other calls CopyTo to get the results into a destination span.","created_at":"2017-10-06T16:09:13Z","updated_at":"2017-10-06T16:09:14Z","html_url":"https://github.com/dotnet/coreclr/pull/14352#discussion_r143230884","pull_request_url":"https://api.github.com/repos/dotnet/coreclr/pulls/14352","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments/143230884"},"html":{"href":"https://github.com/dotnet/coreclr/pull/14352#discussion_r143230884"},"pull_request":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/14352"}},"in_reply_to_id":143229995},"pull_request":{"url":"https://api.github.com/repos/dotnet/coreclr/pulls/14352","id":145066105,"html_url":"https://github.com/dotnet/coreclr/pull/14352","diff_url":"https://github.com/dotnet/coreclr/pull/14352.diff","patch_url":"https://github.com/dotnet/coreclr/pull/14352.patch","issue_url":"https://api.github.com/repos/dotnet/coreclr/issues/14352","number":14352,"state":"open","locked":false,"title":"Add Span-based methods to DateTime{Offset}","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars0.githubusercontent.com/u/2642209?v=4","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"body":"Contributes to https://github.com/dotnet/corefx/issues/22358\r\ncc: @tarekgh, @AlexGhiondea, @joperezr, @jkotas ","created_at":"2017-10-06T03:35:50Z","updated_at":"2017-10-06T16:09:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0932a8b99050ed475867e4d7292930aa3bee9890","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/coreclr/pulls/14352/commits","review_comments_url":"https://api.github.com/repos/dotnet/coreclr/pulls/14352/comments","review_comment_url":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/14352/comments","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/e4533291b47ff4292bed37dd18d1e4d4658e0cf1","head":{"label":"stephentoub:datetime_span","ref":"datetime_span","sha":"e4533291b47ff4292bed37dd18d1e4d4658e0cf1","user":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars0.githubusercontent.com/u/2642209?v=4","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"repo":{"id":30271698,"name":"coreclr","full_name":"stephentoub/coreclr","owner":{"login":"stephentoub","id":2642209,"avatar_url":"https://avatars0.githubusercontent.com/u/2642209?v=4","gravatar_id":"","url":"https://api.github.com/users/stephentoub","html_url":"https://github.com/stephentoub","followers_url":"https://api.github.com/users/stephentoub/followers","following_url":"https://api.github.com/users/stephentoub/following{/other_user}","gists_url":"https://api.github.com/users/stephentoub/gists{/gist_id}","starred_url":"https://api.github.com/users/stephentoub/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephentoub/subscriptions","organizations_url":"https://api.github.com/users/stephentoub/orgs","repos_url":"https://api.github.com/users/stephentoub/repos","events_url":"https://api.github.com/users/stephentoub/events{/privacy}","received_events_url":"https://api.github.com/users/stephentoub/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephentoub/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR. It is an execution engine for .NET apps, performing functions such as IL byte code loading, compilation to machine code and garbage collection. The repo contains the complete up-to-date CoreCLR codebase.","fork":true,"url":"https://api.github.com/repos/stephentoub/coreclr","forks_url":"https://api.github.com/repos/stephentoub/coreclr/forks","keys_url":"https://api.github.com/repos/stephentoub/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephentoub/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephentoub/coreclr/teams","hooks_url":"https://api.github.com/repos/stephentoub/coreclr/hooks","issue_events_url":"https://api.github.com/repos/stephentoub/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/stephentoub/coreclr/events","assignees_url":"https://api.github.com/repos/stephentoub/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/stephentoub/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/stephentoub/coreclr/tags","blobs_url":"https://api.github.com/repos/stephentoub/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephentoub/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephentoub/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephentoub/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephentoub/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/stephentoub/coreclr/languages","stargazers_url":"https://api.github.com/repos/stephentoub/coreclr/stargazers","contributors_url":"https://api.github.com/repos/stephentoub/coreclr/contributors","subscribers_url":"https://api.github.com/repos/stephentoub/coreclr/subscribers","subscription_url":"https://api.github.com/repos/stephentoub/coreclr/subscription","commits_url":"https://api.github.com/repos/stephentoub/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephentoub/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephentoub/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephentoub/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephentoub/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/stephentoub/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephentoub/coreclr/merges","archive_url":"https://api.github.com/repos/stephentoub/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephentoub/coreclr/downloads","issues_url":"https://api.github.com/repos/stephentoub/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/stephentoub/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/stephentoub/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/stephentoub/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephentoub/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/stephentoub/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/stephentoub/coreclr/deployments","created_at":"2015-02-04T00:05:29Z","updated_at":"2016-01-11T23:51:52Z","pushed_at":"2017-10-06T12:27:57Z","git_url":"git://github.com/stephentoub/coreclr.git","ssh_url":"git@github.com:stephentoub/coreclr.git","clone_url":"https://github.com/stephentoub/coreclr.git","svn_url":"https://github.com/stephentoub/coreclr","homepage":"","size":182198,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"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":"dotnet:master","ref":"master","sha":"9c6e5b689e043beccdb97385727367e5f0277ac1","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":30092893,"name":"coreclr","full_name":"dotnet/coreclr","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/coreclr","description":"This repo contains the .NET Core runtime, called CoreCLR, and the base library, called System.Private.Corelib (or mscorlib). It includes the garbage collector, JIT compiler, base .NET data types and many low-level classes. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/coreclr","forks_url":"https://api.github.com/repos/dotnet/coreclr/forks","keys_url":"https://api.github.com/repos/dotnet/coreclr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/coreclr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/coreclr/teams","hooks_url":"https://api.github.com/repos/dotnet/coreclr/hooks","issue_events_url":"https://api.github.com/repos/dotnet/coreclr/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/coreclr/events","assignees_url":"https://api.github.com/repos/dotnet/coreclr/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/coreclr/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/coreclr/tags","blobs_url":"https://api.github.com/repos/dotnet/coreclr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/coreclr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/coreclr/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/coreclr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/coreclr/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/coreclr/languages","stargazers_url":"https://api.github.com/repos/dotnet/coreclr/stargazers","contributors_url":"https://api.github.com/repos/dotnet/coreclr/contributors","subscribers_url":"https://api.github.com/repos/dotnet/coreclr/subscribers","subscription_url":"https://api.github.com/repos/dotnet/coreclr/subscription","commits_url":"https://api.github.com/repos/dotnet/coreclr/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/coreclr/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/coreclr/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/coreclr/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/coreclr/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/coreclr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/coreclr/merges","archive_url":"https://api.github.com/repos/dotnet/coreclr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/coreclr/downloads","issues_url":"https://api.github.com/repos/dotnet/coreclr/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/coreclr/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/coreclr/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/coreclr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/coreclr/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/coreclr/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/coreclr/deployments","created_at":"2015-01-30T22:10:02Z","updated_at":"2017-10-06T14:14:55Z","pushed_at":"2017-10-06T15:34:36Z","git_url":"git://github.com/dotnet/coreclr.git","ssh_url":"git@github.com:dotnet/coreclr.git","clone_url":"https://github.com/dotnet/coreclr.git","svn_url":"https://github.com/dotnet/coreclr","homepage":"https://github.com/dotnet/core","size":184166,"stargazers_count":8424,"watchers_count":8424,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2115,"mirror_url":null,"open_issues_count":1445,"forks":2115,"open_issues":1445,"watchers":8424,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/14352"},"html":{"href":"https://github.com/dotnet/coreclr/pull/14352"},"issue":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/14352"},"comments":{"href":"https://api.github.com/repos/dotnet/coreclr/issues/14352/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/14352/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/coreclr/pulls/14352/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/coreclr/statuses/e4533291b47ff4292bed37dd18d1e4d4658e0cf1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"stephentoub"}}