67 references to FormatDate
Microsoft.AspNetCore.Http.Extensions (1)
HeaderDictionaryTypeExtensions.cs (1)
127headers[name] = HeaderUtilities.FormatDate(value.GetValueOrDefault());
Microsoft.AspNetCore.Mvc.Core.Test (2)
FileResultHelperTest.cs (2)
405httpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(ifModifiedSince); 443httpContext.Request.Headers.IfUnmodifiedSince = HeaderUtilities.FormatDate(ifUnmodifiedSince);
Microsoft.AspNetCore.OutputCaching.Tests (20)
OutputCacheMiddlewareTests.cs (16)
179context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 183entry.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.Date] = HeaderUtilities.FormatDate(value) }); 217context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 223[HeaderNames.Date] = HeaderUtilities.FormatDate(date), 224[HeaderNames.LastModified] = HeaderUtilities.FormatDate(lastModified), 260context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 261entry.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)) }); 281context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 282context.CachedResponse.CopyHeadersFrom(new HeaderDictionary { [HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)) }); 433context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 461context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 487context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 547Assert.Equal(HeaderUtilities.FormatDate(utcNow), context.HttpContext.Response.Headers.Date); 562context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 565Assert.Equal(HeaderUtilities.FormatDate(utcNow), context.HttpContext.Response.Headers.Date); 569Assert.Equal(HeaderUtilities.FormatDate(responseTime), context.HttpContext.Response.Headers.Date);
OutputCachePolicyProviderTests.cs (4)
339context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 361context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(utcNow); 362context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 385context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow);
Microsoft.AspNetCore.ResponseCaching (1)
ResponseCachingMiddleware.cs (1)
301headers.Date = HeaderUtilities.FormatDate(context.ResponseDate.Value);
Microsoft.AspNetCore.ResponseCaching.Tests (36)
ResponseCachingMiddlewareTests.cs (22)
195context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 198context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 203context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow); 208context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 226context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 229context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 230context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 235context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 236context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow); 241context.CachedResponseHeaders[HeaderNames.Date] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 242context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 261context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 262context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow + TimeSpan.FromSeconds(10)); 280context.HttpContext.Request.Headers.IfModifiedSince = HeaderUtilities.FormatDate(utcNow); 281context.CachedResponseHeaders[HeaderNames.LastModified] = HeaderUtilities.FormatDate(utcNow - TimeSpan.FromSeconds(10)); 459context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(now + TimeSpan.FromSeconds(11)); 484context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 509context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(timeProvider.GetUtcNow() + TimeSpan.FromSeconds(11)); 631Assert.Equal(HeaderUtilities.FormatDate(utcNow), context.HttpContext.Response.Headers.Date); 643context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 646Assert.Equal(HeaderUtilities.FormatDate(utcNow), context.HttpContext.Response.Headers.Date); 650Assert.Equal(HeaderUtilities.FormatDate(utcNow), context.HttpContext.Response.Headers.Date);
ResponseCachingPolicyProviderTests.cs (14)
372context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 390context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(utcNow); 392context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 413context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(utcNow); 414context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 433context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(utcNow); 434context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 456context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 476context.HttpContext.Response.Headers.Date = HeaderUtilities.FormatDate(utcNow); 530context.CachedResponseHeaders[HeaderNames.Expires] = HeaderUtilities.FormatDate(utcNow); 552context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(utcNow); 572context.HttpContext.Response.Headers.Expires = HeaderUtilities.FormatDate(utcNow); 595context.CachedResponseHeaders[HeaderNames.Expires] = HeaderUtilities.FormatDate(utcNow); 616context.CachedResponseHeaders[HeaderNames.Expires] = HeaderUtilities.FormatDate(utcNow);
Microsoft.AspNetCore.Rewrite.Tests (1)
UrlActions\ChangeCookieActionTests.cs (1)
31Assert.Equal($"Cookie=Chocolate%20Chip; expires={HeaderUtilities.FormatDate(now.AddMinutes(1440))}; domain=contoso.com; path=/recipes; secure; httponly", header);
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Internal\Http\DateHeaderValueManager.cs (1)
46var dateValue = HeaderUtilities.FormatDate(value);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (1)
KestrelServerTests.cs (1)
747Assert.Equal(HeaderUtilities.FormatDate(testContext.FakeTimeProvider.GetUtcNow()),
Microsoft.Net.Http.Headers (2)
RangeConditionHeaderValue.cs (1)
76return HeaderUtilities.FormatDate(_lastModified.GetValueOrDefault());
SetCookieHeaderValue.cs (1)
345AppendSegment(builder, ExpiresToken, HeaderUtilities.FormatDate(Expires.GetValueOrDefault()));
Microsoft.Net.Http.Headers.Tests (2)
DateParserTest.cs (2)
46HeaderUtilities.FormatDate(new DateTimeOffset(2010, 7, 31, 15, 38, 57, TimeSpan.Zero))); 49HeaderUtilities.FormatDate(new DateTimeOffset(2010, 1, 1, 1, 1, 1, TimeSpan.Zero)));