Skip to content

Commit ae9db2f

Browse files
Update DateOnly - Add Remarks
Adding remarks to DateOnly, mainly to have a link to Format Strings (always found it easier to go through DateTime.ParseExact to get to that page).
1 parent ca3aa1a commit ae9db2f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

xml/System/DateOnly.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,16 @@
939939
<summary>Converts the specified string representation of a date to its <see cref="T:System.DateOnly" /> equivalent using the specified format.
940940
The format of the string representation must match the specified format exactly or an exception is thrown.</summary>
941941
<returns>An object that is equivalent to the date contained in <paramref name="s" />, as specified by format.</returns>
942-
<remarks>To be added.</remarks>
942+
<remarks>
943+
<format type="text/markdown"><![CDATA[
944+
## Remarks
945+
The <xref:System.DateOnly.ParseExact%28System.String%2CSystem.String%29?displayProperty=nameWithType> method parses the string representation of a date, which must be in the format defined by the `format` parameter. It also requires that the \<Date> element of the string representation of a date appear in the order specified by `format`, and that `s` have no white space other than that permitted by `format`.
946+
If `s` does not represent a time in a particular time zone and the parse operation succeeds, the <xref:System.DateTime.Kind%2A> property of the returned <xref:System.DateTime> value is <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>. If `s` does represent the time in a particular time zone and `format` allows time zone information to be present (for example, if `format` is equal to the "o", "r", or "u" standard format specifiers, or if it contains the "z", "zz", or "zzz" custom format specifiers), the <xref:System.DateTime.Kind%2A> property of the returned <xref:System.DateTime> value is <xref:System.DateTimeKind.Local?displayProperty=nameWithType>.
947+
The `format` parameter is a string that contains either a single standard format specifier, or one or more custom format specifiers that define the required format of `s`. For details about valid formatting codes, see [Standard Date and Time Format Strings](/dotnet/standard/base-types/standard-date-and-time-format-strings) or [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings).
948+
> [!NOTE]
949+
> If `format` is a custom format pattern that does not include date separators (such as "yyyyMMdd"), use the widest form of each custom format specifier. For example, if you want to specify months in the format pattern, specify the wider form, "MM", instead of the narrower form, "M".
950+
]]></format>
951+
</remarks>
943952
<exception cref="T:System.ArgumentNullException">
944953
<paramref name="s" /> is <see langword="null" />.</exception>
945954
<exception cref="T:System.FormatException">

0 commit comments

Comments
 (0)