Skip to content

Commit afc9aa9

Browse files
AWilcogewarrencarlossanlop
authored andcommitted
Update Docs for DateTime.Ticks to explain it depends on the time zone of the object instance. (#3355)
* Update DateTime.xml Corrected documentation of Ticks property to include information that it is related to the number of ticks since 0:00:00 on January 1, 0001 in the time zone of the the DateTime instance, and not UTC. Thus using ToUniversalTime() and ToLocalTime() can change the number of ticks, even though it represents the same instance of time. As documented here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/fde7e5b0-e2b9-4d3b-8a63-c2ae75e316d8/datetimeticks-bug?forum=netfxbcl And tested on .NET 4.5.1. If this has changed in the latest .NET runtimes, the documentation says that it has not and is the same functionality as 4.5.1 * Update DateTime.xml Ticks Property Remarks Incorporated feedback from review. * Update xml/System/DateTime.xml Co-Authored-By: Genevieve Warren <[email protected]> * Update xml/System/DateTime.xml Co-Authored-By: Genevieve Warren <[email protected]> * Update xml/System/DateTime.xml Co-Authored-By: Carlos Sanchez Lopez <[email protected]> * Update xml/System/DateTime.xml Co-Authored-By: Carlos Sanchez Lopez <[email protected]> * Update xml/System/DateTime.xml Co-Authored-By: Genevieve Warren <[email protected]> Co-authored-by: Genevieve Warren <[email protected]> Co-authored-by: Carlos Sanchez Lopez <[email protected]>
1 parent d051573 commit afc9aa9

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

xml/System/DateTime.xml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6924,9 +6924,13 @@ The following example demonstrates the <xref:System.DateTime.Parse%28System.Stri
69246924
## Remarks
69256925
A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond, or 10 million ticks in a second.
69266926

6927-
The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 (0:00:00 UTC on January 1, 0001, in the Gregorian calendar), which represents <xref:System.DateTime.MinValue?displayProperty=nameWithType>. It does not include the number of ticks that are attributable to leap seconds.
6928-
6929-
6927+
The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001 in the Gregorian calendar, which represents <xref:System.DateTime.MinValue>. It does not include the number of ticks that are attributable to leap seconds.
6928+
If the DateTime object has its `Kind` property set to `Local`, its ticks represent the time elapsed time since 12:00:00 midnight, January 1, 0001 in the local time as specified by the current time zone setting.
6929+
If the `DateTime` object has its `Kind` property set to `Utc`, its ticks represent the time elapsed time since 12:00:00 midnight, January 1, 0001 in the Coordinated Universal Time.
6930+
If the `DateTime` object has its `Kind` property set to `Unspecified`, its ticks represent the time elapsed time since 12:00:00 midnight, January 1, 0001 in the unknown time zone.
6931+
6932+
In general, the ticks represent the time according to the time zone specified by the `Kind` property.
6933+
69306934

69316935
## Examples
69326936

0 commit comments

Comments
 (0)