200 references to new
Aspire.Dashboard.Components.Tests (1)
Shared\TestTimeProvider.cs (1)
17UtcNow = new DateTimeOffset(2025, 12, 20, 23, 59, 59, TimeSpan.Zero);
Aspire.Hosting.Testing.Tests (1)
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (1)
63return new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
Aspire.Hosting.Tests (5)
tests\Shared\ConsoleLogging\ConsoleLoggingTestHelpers.cs (1)
63return new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
VersionChecking\VersionCheckServiceTests.cs (4)
70var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 105var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 145var currentDate = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero); 269public DateTimeOffset UtcNow { get; set; } = new DateTimeOffset(2000, 12, 29, 20, 59, 59, TimeSpan.Zero);
FilesWebSite (2)
Controllers\DownloadFilesController.cs (2)
30var lastModified = new DateTimeOffset(year: 1999, month: 11, day: 04, hour: 3, minute: 0, second: 0, offset: new TimeSpan(0)); 44var lastModified = new DateTimeOffset(year: 1999, month: 11, day: 04, hour: 3, minute: 0, second: 0, offset: new TimeSpan(0));
Microsoft.AspNetCore.Authentication.Core.Test (4)
AuthenticationPropertiesTests.cs (4)
311ExpiresUtc = new DateTimeOffset(2021, 03, 28, 13, 47, 00, TimeSpan.Zero), 312IssuedUtc = new DateTimeOffset(2021, 03, 28, 12, 47, 00, TimeSpan.Zero), 367ExpiresUtc = new DateTimeOffset(2021, 03, 28, 13, 47, 00, TimeSpan.Zero), 368IssuedUtc = new DateTimeOffset(2021, 03, 28, 12, 47, 00, TimeSpan.Zero),
Microsoft.AspNetCore.Authorization.Test (2)
AuthorizationMiddlewareTests.cs (2)
823var firstExpiration = new DateTimeOffset(2021, 5, 12, 2, 3, 4, TimeSpan.Zero); 824var secondExpiration = new DateTimeOffset(2021, 5, 11, 2, 3, 4, TimeSpan.Zero);
Microsoft.AspNetCore.Components.Endpoints.Tests (2)
Binding\FormDataMapperTests.cs (2)
2126{ "4/20/2023 12:56:34 PM +02:00", typeof(DateTimeOffset?), new DateTimeOffset?(new DateTimeOffset(2023, 04, 20, 12, 56, 34, TimeSpan.FromHours(2)))}, 2211{ "4/20/2023 12:56:34 PM +02:00", typeof(DateTimeOffset), new DateTimeOffset(2023, 04, 20, 12, 56, 34, TimeSpan.FromHours(2)) },
Microsoft.AspNetCore.Components.Server.Tests (1)
Circuits\DefaultInMemoryCircuitPersistenceProviderTest.cs (1)
179UtcNow = new DateTimeOffset(2020, 1, 1, 0, 0, 0, TimeSpan.Zero);
Microsoft.AspNetCore.Components.Tests (2)
PersistentStateValueProviderKeyResolverTests.cs (2)
33{ new DateTimeOffset(2023, 1, 1, 0, 0, 0, TimeSpan.FromSeconds(0)), new DateTimeOffset(2023, 12, 31, 0, 0, 0, TimeSpan.FromSeconds(0)) },
Microsoft.AspNetCore.DataProtection.Tests (7)
KeyManagement\XmlKeyManagerTests.cs (7)
78var creationDate = new DateTimeOffset(2014, 01, 01, 0, 0, 0, TimeSpan.Zero); 79var activationDate = new DateTimeOffset(2014, 02, 01, 0, 0, 0, TimeSpan.Zero); 80var expirationDate = new DateTimeOffset(2014, 03, 01, 0, 0, 0, TimeSpan.Zero); 165var creationDate = new DateTimeOffset(2014, 01, 01, 0, 0, 0, TimeSpan.Zero); 166var activationDate = new DateTimeOffset(2014, 02, 01, 0, 0, 0, TimeSpan.Zero); 167var expirationDate = new DateTimeOffset(2014, 03, 01, 0, 0, 0, TimeSpan.Zero); 685var revocationDate = new DateTimeOffset(2014, 01, 01, 0, 0, 0, TimeSpan.Zero);
Microsoft.AspNetCore.Grpc.JsonTranscoding.Tests (3)
ConverterTests\JsonConverterWriteTests.cs (2)
305TimestampValue = Timestamp.FromDateTimeOffset(new DateTimeOffset(2020, 12, 1, 12, 30, 0, TimeSpan.FromHours(12))) 314var ts = Timestamp.FromDateTimeOffset(new DateTimeOffset(2020, 12, 1, 12, 30, 0, TimeSpan.FromHours(12)));
UnaryServerCallHandlerTests.cs (1)
1754var timestamp = Timestamp.FromDateTimeOffset(new DateTimeOffset(2023, 2, 14, 17, 32, 0, TimeSpan.FromHours(8)));
Microsoft.AspNetCore.Http.Extensions.Tests (1)
HeaderDictionaryTypeExtensionsTest.cs (1)
107var expected = new DateTimeOffset(2023, 12, 04, 7, 28, 00, TimeSpan.Zero);
Microsoft.AspNetCore.Http.Results.Tests (14)
PhysicalFileResultTest.cs (1)
31LastWriteTimeUtc = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0))
ResultsTests.cs (5)
285new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 287new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 333new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 335new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 337new object[] { 2, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any },
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
514lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0));
TypedResultsTests.cs (7)
263new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 265new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 309new object[] { "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 311new object[] { "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 417new object[] { 0, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 419new object[] { 1, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any }, 421new object[] { 2, "text/plain", "testfile", true, new DateTimeOffset(2022, 1, 1, 0, 0, 1, TimeSpan.FromHours(-8)), EntityTagHeaderValue.Any },
Microsoft.AspNetCore.Identity.Test (1)
SecurityStampValidatorTest.cs (1)
314now = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Offset); // Truncate to the nearest second.
Microsoft.AspNetCore.Mvc.Core.Test (23)
FileResultHelperTest.cs (13)
251lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0)); 329lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0)); 365lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0)); 388{ new DateTimeOffset(2018, 4, 9, 11, 23, 22, TimeSpan.Zero), 200 }, 389{ new DateTimeOffset(2018, 4, 9, 11, 24, 21, TimeSpan.Zero), 200 }, 390{ new DateTimeOffset(2018, 4, 9, 11, 24, 22, TimeSpan.Zero), 304 }, 391{ new DateTimeOffset(2018, 4, 9, 11, 24, 23, TimeSpan.Zero), 304 }, 392{ new DateTimeOffset(2018, 4, 9, 11, 25, 22, TimeSpan.Zero), 304 }, 428{ new DateTimeOffset(2018, 4, 9, 11, 23, 22, TimeSpan.Zero), 412 }, 429{ new DateTimeOffset(2018, 4, 9, 11, 24, 21, TimeSpan.Zero), 412 }, 430{ new DateTimeOffset(2018, 4, 9, 11, 24, 22, TimeSpan.Zero), 200 }, 431{ new DateTimeOffset(2018, 4, 9, 11, 24, 23, TimeSpan.Zero), 200 }, 432{ new DateTimeOffset(2018, 4, 9, 11, 25, 22, TimeSpan.Zero), 200 },
Formatters\FormatFilterTest.cs (1)
309context.RouteData.Values["format"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
Infrastructure\ActionSelectionTableTest.cs (2)
83new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7))); 123new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)));
Infrastructure\ActionSelectorTest.cs (1)
99new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)));
ModelBinding\RouteValueProviderTests.cs (2)
53{ "test-key", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) }, 70{ "test-key", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
PhysicalFileResultTest.cs (1)
51LastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0))
Routing\KnownRouteValueConstraintTests.cs (1)
259{ "randomKey", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
Routing\UrlHelperExtensionsTest.cs (1)
258{ "page", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
514lastModified = new DateTimeOffset(lastModified.Year, lastModified.Month, lastModified.Day, lastModified.Hour, lastModified.Minute, lastModified.Second, TimeSpan.FromSeconds(0));
Microsoft.AspNetCore.Mvc.Razor.Test (1)
RazorViewEngineTest.cs (1)
1644actionContext.RouteData.Values[key] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\DefaultPageHandlerMethodSelectorTest.cs (1)
407{ "handler", new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7)) },
Microsoft.AspNetCore.Mvc.TagHelpers.Test (8)
CacheTagHelperTest.cs (3)
326var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 379var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 432var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero);
CacheTagKeyTest.cs (1)
316new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
DistributedCacheTagHelperTest.cs (3)
349var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 411var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero); 473var currentTime = new DateTimeOffset(2010, 1, 1, 0, 0, 0, TimeSpan.Zero);
InputTagHelperTest.cs (1)
712DateTimeOffset = new DateTimeOffset(2011, 8, 31, hour: 5, minute: 30, second: 45, offset: TimeSpan.FromHours(3))
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
PartialViewResultExecutorTest.cs (1)
83context.RouteData.Values["action"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
ViewResultExecutorTest.cs (1)
82context.RouteData.Values["action"] = new DateTimeOffset(2018, 10, 31, 7, 37, 38, TimeSpan.FromHours(-7));
Microsoft.AspNetCore.ResponseCaching.Tests (1)
ResponseCachingMiddlewareTests.cs (1)
449now = new DateTimeOffset(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, now.Offset).AddSeconds(1); // Round up to seconds.
Microsoft.AspNetCore.Session.Tests (1)
SessionTests.cs (1)
1134UtcNow = new DateTimeOffset(2013, 1, 1, 1, 0, 0, TimeSpan.Zero);
Microsoft.AspNetCore.StaticAssets.Tests (2)
StaticAssetsIntegrationTests.cs (2)
585new("Last-Modified", new DateTimeOffset(2023,03,03,0,0,0,TimeSpan.Zero).ToString("ddd, dd MMM yyyy HH:mm:ss 'GMT'", CultureInfo.InvariantCulture)) 1086public DateTimeOffset LastModified => new(2023, 03, 03, 0, 0, 0, TimeSpan.Zero);
Microsoft.AspNetCore.StaticFiles (1)
StaticFileContext.cs (1)
124_lastModified = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset).ToUniversalTime();
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
StaticFileMiddlewareTests.cs (1)
111var trimmed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, TimeSpan.Zero).ToUniversalTime();
Microsoft.AspNetCore.StaticFiles.Tests (5)
StaticFileContextTest.cs (4)
43LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) 69LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) 98LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero) 125LastModified = new DateTimeOffset(2014, 1, 2, 3, 4, 5, TimeSpan.Zero)
StaticFileMiddlewareTests.cs (1)
132var trimmed = new DateTimeOffset(last.Year, last.Month, last.Day, last.Hour, last.Minute, last.Second, last.Offset).ToUniversalTime();
Microsoft.DotNet.Build.Tasks.Installers (1)
src\RpmBuilder.cs (1)
181private static readonly DateTimeOffset UnixEpoch = new(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
Microsoft.DotNet.XUnitAssert.Tests (21)
EqualityAssertsTests.cs (16)
1812 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1813 var actual = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1826 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1827 var actual = new DateTimeOffset(2023, 2, 11, 15, 5, 0, TimeSpan.Zero); 1846 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1847 var actual = new DateTimeOffset(2023, 2, 11, 16, 4, 0, TimeSpan.FromHours(1)); 1859 var expected = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1860 var actual = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.FromHours(1)); 1879 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1880 var date2 = new DateTimeOffset(2023, 2, 11, 15, 5, 0, TimeSpan.Zero); 1894 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1895 var date2 = new DateTimeOffset(2023, 2, 11, 15, 6, 0, TimeSpan.Zero); 1928 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1929 var date2 = new DateTimeOffset(2023, 2, 11, 16, 5, 0, TimeSpan.FromHours(1)); 1943 var date1 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.Zero); 1944 var date2 = new DateTimeOffset(2023, 2, 11, 15, 4, 0, TimeSpan.FromHours(1));
EquivalenceAssertsTests.cs (4)
1503 var expected = new DateTimeOffset(2022, 12, 1, 1, 3, 1, TimeSpan.Zero); 1504 var actual = new DateTimeOffset(2022, 12, 1, 1, 3, 1, TimeSpan.Zero); 1512 var expected = new DateTimeOffset(2022, 12, 1, 1, 3, 1, TimeSpan.Zero); 1513 var actual = new DateTimeOffset(2011, 9, 13, 18, 22, 0, TimeSpan.Zero);
Sdk\ArgumentFormatterTests.cs (1)
477 MyProp3 = new DateTimeOffset(2014, 04, 17, 07, 45, 23, TimeSpan.Zero);
Microsoft.Extensions.AI.Abstractions.Tests (28)
ChatCompletion\ChatResponseTests.cs (11)
61response.CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero); 62Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 91CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 108Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt); 135CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 148Assert.Equal(new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), update0.CreatedAt); 164CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 169CreatedAt = new DateTimeOffset(2025, 1, 1, 10, 30, 0, TimeSpan.Zero), 177CreatedAt = new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), 190Assert.Equal(new DateTimeOffset(2024, 11, 10, 9, 20, 0, TimeSpan.Zero), update0.CreatedAt); 199Assert.Equal(new DateTimeOffset(2025, 1, 1, 10, 30, 0, TimeSpan.Zero), update1.CreatedAt);
ChatCompletion\ChatResponseUpdateExtensionsTests.cs (13)
31new(ChatRole.Assistant, "Hello") { ResponseId = "someResponse", MessageId = "12345", CreatedAt = new DateTimeOffset(1, 2, 3, 4, 5, 6, TimeSpan.Zero), ModelId = "model123" }, 33new(null, "world!") { CreatedAt = new DateTimeOffset(2, 2, 3, 4, 5, 6, TimeSpan.Zero), ConversationId = "123", AdditionalProperties = new() { ["c"] = "d" } }, 49Assert.Equal(new DateTimeOffset(2, 2, 3, 4, 5, 6, TimeSpan.Zero), response.CreatedAt); 77new(null, "Hi! ") { CreatedAt = new DateTimeOffset(2023, 1, 1, 10, 0, 0, TimeSpan.Zero), AuthorName = "Assistant" }, 78new(ChatRole.Assistant, "Hello") { MessageId = "msg1", CreatedAt = new DateTimeOffset(2024, 1, 1, 10, 0, 0, TimeSpan.Zero), AuthorName = "Assistant" }, 79new(null, " from") { MessageId = "msg1", CreatedAt = new DateTimeOffset(2024, 1, 1, 10, 1, 0, TimeSpan.Zero) }, // Later CreatedAt should win 83new(ChatRole.User, "How") { MessageId = "msg2", CreatedAt = new DateTimeOffset(2024, 1, 1, 11, 0, 0, TimeSpan.Zero), AuthorName = "User" }, 84new(null, " are") { MessageId = "msg2", CreatedAt = new DateTimeOffset(2024, 1, 1, 11, 1, 0, TimeSpan.Zero) }, 88new(ChatRole.Assistant, "I'm doing well,") { MessageId = "msg3", CreatedAt = new DateTimeOffset(2024, 1, 1, 12, 0, 0, TimeSpan.Zero) }, 89new(null, " thank you!") { MessageId = "msg3", CreatedAt = new DateTimeOffset(2024, 1, 1, 12, 2, 0, TimeSpan.Zero) }, // Later CreatedAt should win 107Assert.Equal(new DateTimeOffset(2024, 1, 1, 10, 1, 0, TimeSpan.Zero), message1.CreatedAt); // Last value should win 115Assert.Equal(new DateTimeOffset(2024, 1, 1, 11, 1, 0, TimeSpan.Zero), message2.CreatedAt); // Last value should win 123Assert.Equal(new DateTimeOffset(2024, 1, 1, 12, 2, 0, TimeSpan.Zero), message3.CreatedAt); // Last value should win
ChatCompletion\ChatResponseUpdateTests.cs (4)
76update.CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero); 77Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), update.CreatedAt); 130CreatedAt = new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), 161Assert.Equal(new DateTimeOffset(2022, 1, 1, 0, 0, 0, TimeSpan.Zero), result.CreatedAt);
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIConversionTests.cs (12)
212ChatMessageRole.User, null, null, null, new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 222Assert.Equal(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 253Assert.Equal(new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), response.CreatedAt); 278null, null, null, OpenAI.Chat.ChatFinishReason.ToolCalls, new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 407CreatedAt = new DateTimeOffset(2025, 1, 3, 14, 30, 0, TimeSpan.Zero), 422Assert.Equal(new DateTimeOffset(2025, 1, 3, 14, 30, 0, TimeSpan.Zero), completion.CreatedAt); 569createdAt: new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 596CreatedAt = new DateTimeOffset(2025, 1, 1, 12, 0, 0, TimeSpan.Zero) 611Assert.Equal(new DateTimeOffset(2025, 1, 1, 12, 0, 0, TimeSpan.Zero), streamingUpdate.CreatedAt); 861new DateTimeOffset(2025, 1, 1, 0, 0, 0, TimeSpan.Zero), 890CreatedAt = new DateTimeOffset(2025, 1, 15, 10, 30, 0, TimeSpan.Zero), 899Assert.Equal(new DateTimeOffset(2025, 1, 15, 10, 30, 0, TimeSpan.Zero), openAIResponse.CreatedAt);
Microsoft.Extensions.Caching.SqlServer.Tests (2)
SqlServerCacheWithDatabaseTest.cs (1)
390var expectedAbsoluteExpiration = new DateTimeOffset(2025, 1, 1, 1, 0, 0, TimeSpan.Zero);
TestClock.cs (1)
18UtcNow = new DateTimeOffset(2013, 1, 1, 1, 0, 0, offset: TimeSpan.Zero);
Microsoft.Extensions.Logging.AzureAppServices (1)
BlobLoggerProvider.cs (1)
67new DateTimeOffset(key.Year, key.Month, key.Day, key.Hour, 0, 0, TimeSpan.Zero)));
Microsoft.Extensions.TimeProvider.Testing.Tests (3)
FakeTimeProviderTests.cs (3)
103var timeProvider = new FakeTimeProvider(new DateTimeOffset(2001, 2, 3, 4, 5, 6, TimeSpan.Zero)); 162var timeProvider = new FakeTimeProvider(new DateTimeOffset(2001, 2, 3, 4, 5, 6, TimeSpan.Zero)); 186var timeProvider = new FakeTimeProvider(new DateTimeOffset(2001, 2, 3, 4, 5, 6, TimeSpan.Zero));
Microsoft.ML.Tests (8)
Scenarios\Api\TestApi.cs (8)
423DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(1, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 0) 427DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(2, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 10) 431DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(1, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 10) 435DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(2, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 0) 439DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(3, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 20) 443DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(4, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 30) 447DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(3, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 30) 451DateTimeOffsetStrat = new DateTimeOffset(2002, 2, 23, 3, 30, 0, new TimeSpan(4, 0, 0)), TimeSpanStrat = new TimeSpan(2, 0, 20)
Microsoft.Net.Http.Headers.Tests (25)
DateParserTest.cs (6)
20yield return new object[] { "Tue, 15 Nov 1994 08:12:31 GMT", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero) }; 21yield return new object[] { " Sunday, 06-Nov-94 08:49:37 GMT ", new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero) }; 22yield return new object[] { " Tue,\r\n 15 Nov\r\n 1994 08:12:31 GMT ", new DateTimeOffset(1994, 11, 15, 8, 12, 31, TimeSpan.Zero) }; 23yield return new object[] { "Sat, 09-Dec-2017 07:07:03 GMT ", new DateTimeOffset(2017, 12, 09, 7, 7, 3, TimeSpan.Zero) }; 46HeaderUtilities.FormatDate(new DateTimeOffset(2010, 7, 31, 15, 38, 57, TimeSpan.Zero))); 49HeaderUtilities.FormatDate(new DateTimeOffset(2010, 1, 1, 1, 1, 1, TimeSpan.Zero)));
RangeConditionHeaderValueTest.cs (12)
33new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 35Assert.Equal(new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero), rangeCondition.LastModified); 44rangeCondition = new RangeConditionHeaderValue(new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 54new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 56new DateTimeOffset(2008, 8, 16, 13, 44, 10, TimeSpan.Zero)); 58new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 75new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 77new DateTimeOffset(2008, 8, 16, 13, 44, 10, TimeSpan.Zero)); 79new DateTimeOffset(2010, 7, 15, 12, 33, 57, TimeSpan.Zero)); 97new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero))); 99new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 9, 8, 49, 37, TimeSpan.Zero))); 128new RangeConditionHeaderValue(new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero)));
SetCookieHeaderValueTest.cs (7)
18Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 44Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 135Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 159Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 238Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 259Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero), 271Expires = new DateTimeOffset(1994, 11, 6, 8, 49, 37, TimeSpan.Zero),
System.Formats.Asn1 (2)
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (1)
390value = new DateTimeOffset(year, month, day, hour, minute.Value, second.Value, timeOffset.Value);
System\Formats\Asn1\AsnDecoder.UtcTime.cs (1)
232return new DateTimeOffset(scaledYear, month, day, hour, minute, second, offset);
System.IO.IsolatedStorage (3)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (3)
247return new DateTimeOffset(1601, 1, 1, 0, 0, 0, TimeSpan.Zero).ToLocalTime(); 263return new DateTimeOffset(1601, 1, 1, 0, 0, 0, TimeSpan.Zero).ToLocalTime(); 279return new DateTimeOffset(1601, 1, 1, 0, 0, 0, TimeSpan.Zero).ToLocalTime();
System.Private.CoreLib (2)
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (2)
159DateTimeOffset value = new(year, month, day, hour, minute, 59, offset); 167: this(year, month, day, hour, minute, second, offset)