From abf002c2e68af938e3a42ae2189958006e1fb067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Fri, 15 Apr 2022 04:19:42 +0200 Subject: [PATCH] Fix documentation issues in recent DateTime API additions (#68019) * Fix documentation issues in recent DateTime API additions The microseconds parameter accepts 0-999, not 0-900. * typo Co-authored-by: Dan Moseley --- .../src/System/DateTime.cs | 20 +++++++++---------- .../src/System/DateTimeOffset.cs | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/DateTime.cs b/src/libraries/System.Private.CoreLib/src/System/DateTime.cs index 88d71251c24a4..6623318d2b247 100644 --- a/src/libraries/System.Private.CoreLib/src/System/DateTime.cs +++ b/src/libraries/System.Private.CoreLib/src/System/DateTime.cs @@ -511,7 +511,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// The minutes (0 through 59). /// The seconds (0 through 59). /// The milliseconds (0 through 999). - /// The milliseconds (0 through 900). + /// The microseconds (0 through 999). /// /// is less than 1 or greater than 9999. /// @@ -541,7 +541,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// /// -or- /// - /// is less than 0 or greater than 900. + /// is less than 0 or greater than 999. /// /// /// This constructor interprets , and as a year, month and day @@ -569,7 +569,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// The minutes (0 through 59). /// The seconds (0 through 59). /// The milliseconds (0 through 999). - /// The milliseconds (0 through 900). + /// The microseconds (0 through 999). /// /// One of the enumeration values that indicates whether , , , /// , , , and @@ -603,7 +603,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// /// -or- /// - /// is less than 0 or greater than 900. + /// is less than 0 or greater than 999. /// /// /// is not one of the values. @@ -638,7 +638,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// The minutes (0 through 59). /// The seconds (0 through 59). /// The milliseconds (0 through 999). - /// The milliseconds (0 through 900). + /// The microseconds (0 through 999). /// The calendar that is used to interpret , , and . /// /// is @@ -672,7 +672,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// /// -or- /// - /// is less than 0 or greater than 900. + /// is less than 0 or greater than 999. /// /// /// The allowable values for , , and parameters @@ -698,7 +698,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// The minutes (0 through 59). /// The seconds (0 through 59). /// The milliseconds (0 through 999). - /// The milliseconds (0 through 900). + /// The microseconds (0 through 999). /// The calendar that is used to interpret , , and . /// /// One of the enumeration values that indicates whether , , , @@ -736,7 +736,7 @@ public DateTime(int year, int month, int day, int hour, int minute, int second, /// /// -or- /// - /// is less than 0 or greater than 900. + /// is less than 0 or greater than 999. /// /// /// is not one of the values. @@ -897,7 +897,7 @@ public DateTime AddMilliseconds(double value) /// whose value is the result of this operation. /// /// The fractional part of value is the fractional part of a microsecond. - /// For example, 4.5 is equivalent to 4 microseconds and 50 ticks, where one microseconds = 10 ticks. + /// For example, 4.5 is equivalent to 4 microseconds and 50 ticks, where one microsecond = 10 ticks. /// /// The value parameter is rounded to the nearest integer. /// @@ -1531,7 +1531,7 @@ public DateTimeKind Kind public int Microsecond => (int)((UTicks / TicksPerMicrosecond) % 1000); /// - /// The nanoseconds component, expressed as a value between 0 and 900. + /// The nanoseconds component, expressed as a value between 0 and 900 (in increments of 100 nanoseconds). /// public int Nanosecond => (int)(UTicks % TicksPerMicrosecond) * 100; diff --git a/src/libraries/System.Private.CoreLib/src/System/DateTimeOffset.cs b/src/libraries/System.Private.CoreLib/src/System/DateTimeOffset.cs index 610a63239ea19..6c0cce89e445a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/DateTimeOffset.cs +++ b/src/libraries/System.Private.CoreLib/src/System/DateTimeOffset.cs @@ -238,7 +238,7 @@ public DateTimeOffset(int year, int month, int day, int hour, int minute, int se /// is less than 0 or greater than 999. /// -or- /// - /// is less than 0 or greater than 900. + /// is less than 0 or greater than 999. /// public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, int microsecond, TimeSpan offset) : this(year, month, day, hour, minute, second, millisecond, offset) @@ -302,7 +302,7 @@ public DateTimeOffset(int year, int month, int day, int hour, int minute, int se /// /// -or- /// - /// is less than 0 or greater than 900. + /// is less than 0 or greater than 999. /// /// -or- ///