679 references to DateTime
Aspire.Hosting.Tests (1)
BinaryFormatTests (2)
dotnet-svcutil-lib (8)
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDateTime.cs (6)
409result = new DateTime(DateTime.Now.Year, xdt.Month, xdt.Day);
414TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day);
469dt = new DateTime(DateTime.Now.Year, xdt.Month, xdt.Day);
474TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day);
Microsoft.AspNetCore.Authentication.Test (10)
JwtBearerTests.cs (4)
1081NotBefore = new DateTime(2001, 1, 15),
1082Expires = new DateTime(2000, 2, 20),
1089NotBefore = new DateTime(2045, 1, 15),
1096Expires = new DateTime(2000, 2, 20),
JwtBearerTests_Handler.cs (4)
1155NotBefore = new DateTime(2001, 1, 15),
1156Expires = new DateTime(2000, 2, 20),
1163NotBefore = new DateTime(2045, 1, 15),
1170Expires = new DateTime(2000, 2, 20),
Microsoft.AspNetCore.Components.Tests (8)
Microsoft.AspNetCore.Components.Web.Tests (1)
Microsoft.AspNetCore.Html.Abstractions.Tests (2)
Microsoft.AspNetCore.Identity.Specification.Tests (1)
Microsoft.AspNetCore.Mvc.Core.Test (14)
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (5)
832var dob = new DateTime(2001, 1, 1);
1026var result = ModelBindingResult.Success(new DateTime(2001, 1, 1));
1034Assert.Equal(new DateTime(2001, 1, 1), model.DateOfBirth);
1044DateOfBirth = new DateTime(1900, 1, 1)
1050var result = ModelBindingResult.Success(new DateTime(1800, 1, 1));
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (5)
964var dob = new DateTime(2001, 1, 1);
1188var result = ModelBindingResult.Success(new DateTime(2001, 1, 1));
1196Assert.Equal(new DateTime(2001, 1, 1), model.DateOfBirth);
1206DateOfBirth = new DateTime(1900, 1, 1)
1212var result = ModelBindingResult.Success(new DateTime(1800, 1, 1));
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
Microsoft.AspNetCore.Mvc.Localization.Test (4)
HtmlLocalizerTest.cs (4)
66new object[] { 10, new DateTime(2015, 10, 10) },
71new object[] { 10, new DateTime(2015, 10, 10) },
76new object[] { 10, new DateTime(2015, 10, 10) },
81new object[] { 10, new DateTime(2015, 10, 10) },
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (2)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (5)
Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests (2)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
Microsoft.AspNetCore.SignalR.Common.Tests (1)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.Data.Analysis.Tests (17)
DataFrame.IOTests.cs (4)
561Assert.Equal(new DateTime(2020, 06, 01), dateTimeColumn[0]);
562Assert.Equal(new DateTime(2020, 06, 02), dateTimeColumn[1]);
563Assert.Equal(new DateTime(2020, 06, 03), dateTimeColumn[2]);
565Assert.Equal(new DateTime(2020, 06, 04), dateTimeColumn[4]);
DataFrameIDataViewTests.cs (6)
86Assert.Equal(new DateTime(2021, 06, 04), preview.ColumnView[13].Values[0]);
87Assert.Equal(new DateTime(2021, 06, 05), preview.ColumnView[13].Values[1]);
231Assert.Equal(new DateTime(2021, 06, 04), preview.ColumnView[13].Values[0]);
232Assert.Equal(new DateTime(2021, 06, 05), preview.ColumnView[13].Values[1]);
233Assert.Equal(new DateTime(2021, 06, 08), preview.ColumnView[13].Values[4]);
235Assert.Equal(new DateTime(2021, 06, 10), preview.ColumnView[13].Values[6]);
DataFrameTests.Computations.cs (6)
398new DateTime(2022, 1, 1),
399new DateTime(2020, 1, 1),
400new DateTime(2023, 1, 1),
401new DateTime(2021, 1, 1),
405Assert.Equal(new DateTime(2020, 1, 1), dateTimeColumn.Min());
406Assert.Equal(new DateTime(2023, 1, 1), dateTimeColumn.Max());
Microsoft.Extensions.AI.Abstractions.Tests (2)
Microsoft.Extensions.Caching.Hybrid.Tests (2)
SerializerTests.cs (2)
191["x"] = (42, "Fred", new(2025, 03, 18)),
192["y"] = (43, "Barney", new(2025, 03, 22)),
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Microsoft.Extensions.Options.Contextual.Tests (1)
Microsoft.Gen.Logging.Generated.Tests (1)
Microsoft.Maui.Controls (2)
DatePicker\DatePicker.cs (2)
23 public static readonly BindableProperty MinimumDateProperty = BindableProperty.Create(nameof(MinimumDate), typeof(DateTime), typeof(DatePicker), new DateTime(1900, 1, 1),
27 public static readonly BindableProperty MaximumDateProperty = BindableProperty.Create(nameof(MaximumDate), typeof(DateTime), typeof(DatePicker), new DateTime(2100, 12, 31),
Microsoft.ML.Core.Tests (1)
Microsoft.ML.Samples (5)
Microsoft.ML.Tests (8)
Scenarios\Api\TestApi.cs (8)
422Id = 0, TextStrat = "a", FloatStrat = 3, VectorStrat = new float[]{ 2, 3, 4, 5 }, DateTimeStrat = new DateTime(2002, 2, 23),
426Id = 1, TextStrat = "b", FloatStrat = 3, VectorStrat = new float[]{ 1, 2, 3, 4 }, DateTimeStrat = new DateTime(2020, 2, 23),
430Id = 2, TextStrat = "c", FloatStrat = 4, VectorStrat = new float[]{ 3, 4, 5, 6 }, DateTimeStrat = new DateTime(2018, 2, 23),
434Id = 3, TextStrat = "d", FloatStrat = 4, VectorStrat = new float[]{ 4, 5, 6, 7 }, DateTimeStrat = new DateTime(2016, 2, 23),
438Id = 4, TextStrat = "a", FloatStrat = -493.28f, VectorStrat = new float[]{ 2, 3, 4, 5 }, DateTimeStrat = new DateTime(2016, 2, 23),
442Id = 5, TextStrat = "b", FloatStrat = -493.28f, VectorStrat = new float[]{ 1, 2, 3, 4 }, DateTimeStrat = new DateTime(2018, 2, 23),
446Id = 6, TextStrat = "c", FloatStrat = 6, VectorStrat = new float[]{ 3, 4, 5, 6 }, DateTimeStrat = new DateTime(2020,2 , 23),
450Id = 7, TextStrat = "d", FloatStrat = 6, VectorStrat = new float[]{ 4, 5, 6, 7 }, DateTimeStrat = new DateTime(2002, 2, 23),
Microsoft.Net.Http.Headers.Tests (1)
Microsoft.VisualBasic.Core (1)
PresentationBuildTasks (1)
PresentationFramework (9)
System\Windows\Controls\Calendar.cs (7)
728return new DateTime(DisplayDate.Year, 1, 1);
1364DateTime? selectedDate = new DateTime(this.DisplayDateInternal.Year, this.DisplayDateInternal.Month, 1);
1384DateTime selectedMonth = new DateTime(this.DisplayDate.Year, 12, 1);
1391DateTime? selectedYear = new DateTime(DateTimeHelper.EndOfDecade(this.DisplayDate), 1, 1);
1427DateTime? selectedDate = new DateTime(this.DisplayDateInternal.Year, this.DisplayDateInternal.Month, 1);
1434DateTime selectedMonth = new DateTime(this.DisplayDate.Year, 1, 1);
1441DateTime? selectedYear = new DateTime(DateTimeHelper.DecadeOfDate(this.DisplayDate), 1, 1);
ScenarioTests.Common.Tests (2)
Shared.Tests (2)
System.Data.Common (2)
System.Data.Odbc (1)
System.Private.CoreLib (42)
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (14)
143private static readonly DateTime s_maxDateOnly = new DateTime(9999, 12, 31);
144private static readonly DateTime s_minDateOnly = new DateTime(1, 1, 2);
1376new DateTime(daylightTime.Start.Year, 1, 1) :
1380new DateTime(daylightTime.End.Year + 1, 1, 1).AddTicks(-1) :
1405new DateTime(daylightTime.Start.Year, 1, 1) :
1409new DateTime(daylightTime.End.Year + 1, 1, 1).AddTicks(-1) :
1495startTime = new DateTime(startYear, 1, 1) - dstStartOffset;
1513endTime = new DateTime(endYear + 1, 1, 1).AddTicks(-1) - dstEndOffset;
1577AdjustmentRule? nextYearRule = zone.GetAdjustmentRuleForTime(new DateTime(nextYear, 1, 1), out int? nextYearRuleIndex);
1594dstEnd = new DateTime(nextYear, 12, 31) - utc - nextYearRule.BaseUtcOffsetDelta - nextYearRule.DaylightDelta;
1627AdjustmentRule? previousYearRule = zone.GetAdjustmentRuleForTime(new DateTime(previousYear, 12, 31), out int? previousYearRuleIndex);
1942value = new DateTime(year, transitionTime.Month, day) + timeOfDay;
1951value = new DateTime(year, transitionTime.Month, 1) + timeOfDay;
1972value = new DateTime(year, transitionTime.Month, daysInMonth) + timeOfDay;
System.Private.Xml (7)
System\Xml\Schema\XsdDateTime.cs (6)
390result = new DateTime(DateTime.Now.Year, xdt.Month, xdt.Day);
395TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day);
450dt = new DateTime(DateTime.Now.Year, xdt.Month, xdt.Day);
455TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day);
System.Reflection.Metadata (1)
System.Windows.Forms (3)
System.Windows.Forms.Primitives.Tests (2)
System.Windows.Forms.Tests (482)
System.Windows.Forms.UI.IntegrationTests (5)
System.Xaml.Tests (2)
System\Windows\Markup\DateTimeValueSerializerTests.cs (1)
65foreach (DateTime date in new DateTime[] { new DateTime(2018, 12, 9), new DateTime(2018, 12, 9, 1, 2, 0, 0), new DateTime(2018, 12, 9, 1, 2, 3, 0) })
System\Xaml\Replacements\DateTimeConverter2Tests.cs (1)
31foreach (DateTime date in new DateTime[] { new DateTime(2018, 12, 9), new DateTime(2018, 12, 9, 1, 2, 0, 0), new DateTime(2018, 12, 9, 1, 2, 3, 0) })
UnsupportedTypes (1)
WindowsBase.Tests (4)
System\Security\RightsManagement\ContentGrantTests.cs (4)
52yield return new object[] { new ContentUser("name", AuthenticationType.Windows), ContentRight.Export, new DateTime(2023, 01, 01), new DateTime(2023, 01, 02) };
86Assert.Throws<ArgumentOutOfRangeException>("validFrom", () => new ContentGrant(user, ContentRight.View, new DateTime(2023, 01, 01), new DateTime(2023, 01, 01).AddTicks(-1)));