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
/// Represents the Unix Epoch value. This field is read-only.
125
+
/// </summary>
126
+
/// <remarks>The value of this constant is equivalent to the <see cref="DateTime"/> corresponding to 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC).
// The data is stored as an unsigned 64-bit integer
120
132
// Bits 01-62: The value of 100-nanosecond ticks where 0 represents 1601/01/01:00:00:00.000, up until the value
121
133
// 3000/12/31:23:59:59.999
@@ -701,6 +713,61 @@ public String ToString(String format)
701
713
returnCompare(t1,t2)>=0;
702
714
}
703
715
716
+
/// <summary>
717
+
/// Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a <see cref="DateTime"/> value.
718
+
/// </summary>
719
+
/// <param name="seconds">A Unix time, expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative.</param>
720
+
/// <returns>A date and time value that represents the same moment in time as the Unix time.</returns>
/// Returns the number of seconds that have elapsed since 1970-01-01T00:00:00Z.
742
+
/// </summary>
743
+
/// <returns>The number of seconds that have elapsed since 1970-01-01T00:00:00Z.</returns>
744
+
/// <remarks>
745
+
/// Unix time represents the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). It does not take leap seconds into account.
746
+
///
747
+
/// This method is exclusive of nanoFramework.
748
+
/// </remarks>
749
+
publiclongToUnixTimeSeconds()
750
+
{
751
+
// Truncate sub-second precision before offsetting by the Unix Epoch to avoid
752
+
// the last digit being off by one for dates that result in negative Unix times.
753
+
//
754
+
// For example, consider the DateTime 12/31/1969 12:59:59.001 +0
0 commit comments