130 references to DateTime
Aspire.Hosting.Tests (1)
ReferenceExpressionTests.cs (1)
53["{0:D}", new DateTime(2024,05,22)],
dotnet-svcutil-lib (8)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\SqlUtils.cs (1)
878DateTime SQLBaseDate = new DateTime(1900, 1, 1);
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);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlCodeExporter.cs (1)
289ticks = (new DateTime(dt.Year, dt.Month, dt.Day)).Ticks;
Microsoft.Build.Tasks.Core (2)
FileState.cs (2)
90LastWriteTimeUtc = new DateTime(1601, 1, 1); 292return _data.Value.Exists ? _data.Value.LastWriteTimeUtc : new DateTime(1601, 1, 1);
Microsoft.CodeAnalysis (1)
VersionHelper.cs (1)
204TimeSpan days = time.Date - new DateTime(2000, 1, 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());
DataFrameTests.Utils.cs (1)
145internal static DateTime SampleDateTime = new DateTime(2021, 06, 04);
Microsoft.Extensions.AI.Abstractions.Tests (2)
parent\parent\Shared\JsonSchemaExporter\TestTypes.cs (2)
80Value: new(2021, 1, 1), 85Value: new(new DateTime(2021, 1, 1), TimeSpan.Zero),
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)
Redaction\RedactorTest.cs (1)
280var data = new DateTime(1, 2, 3);
Microsoft.Extensions.Diagnostics.Testing.Tests (1)
Logging\FakeLoggerTests.cs (1)
122var dt = new DateTime(2022, 5, 22);
Microsoft.Extensions.Options.Contextual.Tests (1)
AcceptanceTests.cs (1)
60Date = new DateTime(2000, 1, 1).AddDays(index),
Microsoft.Gen.Logging.Generated.Tests (1)
LogMethodTests.cs (1)
920var dt = new DateTime(2022, 5, 22);
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)
UnitTests\DataTypes.cs (1)
240DateTime dt = new DateTime(2017, 03, 05);
Microsoft.ML.Samples (5)
Dynamic\DataOperations\DataViewEnumerable.cs (1)
90var date = new DateTime(2012, 1, 1);
Dynamic\DataOperations\FilterRowsByColumn.cs (1)
90var date = new DateTime(2012, 1, 1);
Dynamic\DataOperations\ShuffleRows.cs (1)
78var date = new DateTime(2012, 1, 1);
Dynamic\DataOperations\SkipRows.cs (1)
82var date = new DateTime(2012, 1, 1);
Dynamic\DataOperations\TakeRows.cs (1)
83var date = new DateTime(2012, 1, 1);
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.TemplateEngine.Orchestrator.RunnableProjects (1)
Macros\NowMacro.cs (1)
29DateTime time = new DateTime(1900, 01, 01);
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\DateAndTime.vb (1)
401Return New DateTime(Year, Month, Day)
Mono.Cecil (1)
Mono.Cecil\ModuleDefinition.cs (1)
1327 return (uint) DateTime.UtcNow.Subtract (new DateTime (1970, 1, 1)).TotalSeconds;
PresentationBuildTasks (1)
MS\Internal\MarkupCompiler\VersionHelper.cs (1)
203TimeSpan days = time.Date - new DateTime(2000, 1, 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);
System\Windows\Controls\Primitives\CalendarItem.cs (2)
1226DateTime day = new DateTime(year, 1, 1); 1270DateTime day = new DateTime(DisplayDate.Year, count + 1, 1);
ScenarioTests.Common.Tests (2)
ScenarioTestHelpers.cs (2)
116DateTimeValue = new DateTime(2000, 1, 1), 158DateTimeValue = new DateTime(2000, 1, 1),
Shared.Tests (2)
JsonSchemaExporter\TestTypes.cs (2)
80Value: new(2021, 1, 1), 85Value: new(new DateTime(2021, 1, 1), TimeSpan.Zero),
System.Data.Common (2)
System\Data\SQLTypes\SQLDateTime.cs (2)
40private static DateTime BaseDate => new DateTime(1900, 1, 1); 60get => new DateTime(1753, 1, 1).Subtract(BaseDate);
System.Data.Odbc (1)
Common\System\Data\ProviderBase\DbBuffer.cs (1)
679return new DateTime(
System.Data.OleDb (1)
System\Data\ProviderBase\DbBuffer.cs (1)
632return new DateTime(
System.DirectoryServices.AccountManagement (1)
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_LoadStore.cs (1)
996de.Properties[suggestedWinNTProperty].Value = new DateTime(1970, 1, 1);
System.Private.CoreLib (45)
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (1)
58public DateOnly(int year, int month, int day) => _dayNumber = DayNumberFromDateTime(new DateTime(year, month, day));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (4)
20private static readonly long s_startOf1810 = GetNumberOfDays(new DateTime(1810, 1, 1)); 21private static readonly long s_startOf1900Century = GetNumberOfDays(new DateTime(1900, 1, 1)); 139long july1stOfYear = GetNumberOfDays(new DateTime(gregorianYear, 7, 1)); 147long january1stOfYear = GetNumberOfDays(new DateTime(gregorianYear, 1, 1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\ChineseLunisolarCalendar.cs (1)
21private static readonly DateTime s_minDate = new DateTime(1901, 2, 19);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\EastAsianLunisolarCalendar.cs (1)
656_twoDigitYearMax = GetSystemTwoDigitYearSetting(BaseCalendarID, GetYear(new DateTime(DefaultGregorianTwoDigitYearMax, 1, 1)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\GregorianCalendarHelper.cs (2)
28this.ticks = new DateTime(startYear, startMonth, startDay).Ticks; 39this.ticks = new DateTime(startYear, startMonth, startDay).Ticks;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewCalendar.cs (3)
273private static readonly DateTime s_calendarMinValue = new DateTime(1583, 1, 1); 642beginOfYearDate = new DateTime(1582, 9, 27); 827DateTime gregorianNewYear = new DateTime(gregorianYear, 1, 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\HijriCalendar.cs (1)
61private static readonly DateTime s_calendarMinValue = new DateTime(622, 7, 18);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\ISOWeek.cs (1)
152var jan4 = new DateTime(year, month: 1, day: 4);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.cs (1)
35private static readonly DateTime s_calendarMinValue = new DateTime(1868, 10, 23);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (1)
167dateTime = new DateTime(startYear, startMonth, startDay);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseLunisolarCalendar.cs (1)
22private static readonly DateTime s_minDate = new DateTime(1960, 1, 28);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\KoreanLunisolarCalendar.cs (1)
20private static readonly DateTime s_minDate = new DateTime(918, 2, 19);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\PersianCalendar.cs (2)
24private static readonly long s_persianEpoch = new DateTime(622, 3, 22).Ticks / TimeSpan.TicksPerDay; 41private static readonly DateTime s_minDate = new DateTime(622, 3, 22);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TaiwanCalendar.cs (1)
36private static readonly DateTime s_calendarMinValue = new DateTime(1912, 1, 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TaiwanLunisolarCalendar.cs (1)
30private static readonly DateTime s_minDate = new DateTime(1912, 2, 18);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (2)
25GregorianDate = new DateTime(GYear, GMonth, GDay); 243private static readonly DateTime s_minDate = new DateTime(1900, 4, 30);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (14)
180dateTimeNowCache._nextUtcNowTransitionTicks = utcNow.Year >= MaxYear ? DateTime.MaxTicks : new DateTime(utcNow.Year + 1, 1, 1).Ticks; // check again next year 581value = new DateTime(year, transitionTime.Month, day) + timeOfDay; 590value = new DateTime(year, transitionTime.Month, 1) + timeOfDay; 611value = new DateTime(year, transitionTime.Month, daysInMonth) + timeOfDay; 662DateTime startOfYear = new DateTime(year, 1, 1); 756DateTime transitionStart = new DateTime(year > 1 ? year - 1 : 1, 1, 1); 778DateTime endOfCurrentYear = year < MaxYear ? new DateTime(year + 1, 1, 1).AddTicks(-1) : DateTime.MaxValue; 843DateTime nextBeginningOfYearUtc = GetUtcDateTimeFromLocalTicks(new DateTime(year + 1, 1, 1).Ticks, nextRule, includeDaylightDelta: true); 885DateTime endOfNextYear = year + 1 < MaxYear ? new DateTime(year + 2, 1, 1).AddTicks(-1) : DateTime.MaxValue; 912long startOfCurrentYearUtcTicks = new DateTime(year, 1, 1).Ticks - GetTransitionUtcOffsetTicks(rule, includeDaylightDelta: startWithDaylightOn || localStart > localEnd); 914DateTime currentYearStart = new DateTime(year, 1, 1); 1011DateTime previousYearStart = new DateTime(year > 1 ? year - 1 : 1, 1, 1); // real Utc year start 1038DateTime endOfCurrentYear = year < MaxYear ? new DateTime(year + 1, 1, 1).AddTicks(-1) : DateTime.MaxValue; 1222DateTime endOfCurrentYear = year < MaxYear ? new DateTime(year + 1, 1, 1).AddTicks(-1) : DateTime.MaxValue;
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.StringSerializer.cs (3)
199end = TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1), start.Month == 12 ? 6 : 12, 1); 203private static readonly TransitionTime s_legacyTransitionPlaceholderStart = TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1), 1, 1); 204private static readonly TransitionTime s_legacyTransitionPlaceholderEnd = TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1), 12, 31);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (4)
200DateTime endForFirstRule = new DateTime(start.Year + 1, 1, 1).AddMilliseconds(-1); // At the end of the first year 209DateTime middleYearStart = new DateTime(start.Year + 1, 1, 1); 210DateTime middleYearEnd = new DateTime(end.Year, 1, 1).AddMilliseconds(-1); 217DateTime endYearStart = new DateTime(end.Year, 1, 1); // At the beginning of the last year
System.Private.Xml (7)
System\Xml\BinaryXml\SqlUtils.cs (1)
585DateTime SQLBaseDate = new DateTime(1900, 1, 1);
System\Xml\Schema\XsdDateTime.cs (6)
418result = new DateTime(DateTime.Now.Year, xdt.Month, xdt.Day); 423TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day); 478dt = new DateTime(DateTime.Now.Year, xdt.Month, xdt.Day); 483TimeSpan addDiff = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day) - new DateTime(xdt.Year, xdt.Month, xdt.Day);
System.Windows.Forms (3)
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (3)
64public static readonly DateTime MinDateTime = new(1753, 1, 1); 71public static readonly DateTime MaxDateTime = new(9998, 12, 31); 690return new DateTime(1753, 1, 1);