You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Gets or sets the precision that is used for DateTime values internally. Limiting the precision avoids 'unexpected' tick labels, e.g.
94
+
/// '11:59' for a value of 11:59.99999. The default value is 1 Millisecond.
95
+
/// </summary>
96
+
/// <remarks>For .NET 6 and below, the minimum precision is 1 ms. Using a DateTimePrecision smaller than 1 ms will not result in increased precision.</remarks>
97
+
publicTimeSpanDateTimePrecision{get;set;}
98
+
86
99
/// <summary>
87
100
/// Gets or sets the time zone (used when formatting date/time values).
/// Converts a numeric representation of the date (number of days after the time origin) to a DateTime structure.
140
+
/// Converts a numeric representation of the date (number of days after the time origin) to a DateTime structure, using a precision of 1 Millisecond.
128
141
/// </summary>
129
142
/// <param name="value">The number of days after the time origin.</param>
130
143
/// <returns>A <see cref="DateTime" /> structure. Ticks = 0 if the value is invalid.</returns>
144
+
[Obsolete("Use ConvertToDateTime(double value) or ToDateTime(double value, TimeSpan precision) instead.")]
131
145
publicstaticDateTimeToDateTime(doublevalue)
146
+
{
147
+
returnToDateTime(value,DefaultPrecision);
148
+
}
149
+
150
+
/// <summary>
151
+
/// Converts a numeric representation of the date (number of days after the time origin) to a DateTime structure.
152
+
/// </summary>
153
+
/// <param name="value">The number of days after the time origin.</param>
154
+
/// <param name="precision">The precision that is used for the conversion. The DateTime value is rounded to the next integer multiple of this value.</param>
155
+
/// <returns>A <see cref="DateTime" /> structure. Ticks = 0 if the value is invalid.</returns>
@@ -149,6 +184,16 @@ public static double ToDouble(DateTime value)
149
184
returnspan.TotalDays+1;
150
185
}
151
186
187
+
/// <summary>
188
+
/// Converts a numeric representation of the date (number of days after the time origin) to a DateTime structure, using the precision specified by <see cref="DateTimePrecision" />.
189
+
/// </summary>
190
+
/// <param name="value">The number of days after the time origin.</param>
191
+
/// <returns>A <see cref="DateTime" /> structure. Ticks = 0 if the value is invalid.</returns>
192
+
publicDateTimeConvertToDateTime(doublevalue)
193
+
{
194
+
returnToDateTime(value,this.DateTimePrecision);
195
+
}
196
+
152
197
/// <summary>
153
198
/// Gets the tick values.
154
199
/// </summary>
@@ -175,7 +220,7 @@ public override void GetTickValues(
0 commit comments