DateTimeExtensionsToUnixMilliseconds Method
Gets the time elapsed since the Unix Epoch time (1970-01-01T00:00Z) in milliseconds, not counting leap seconds.
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static long ToUnixMilliseconds(
this DateTime value
)
<ExtensionAttribute>
Public Shared Function ToUnixMilliseconds (
value As DateTime
) As Long
public:
[ExtensionAttribute]
static long long ToUnixMilliseconds(
DateTime value
)
[<ExtensionAttribute>]
static member ToUnixMilliseconds :
value : DateTime -> int64
- value DateTime
- A DateTime value to get the Unix time from.
Int64The number of milliseconds that have elapsed since 1970-01-01T00:00Z.In Visual Basic and C#, you can call this method as an instance method on any object of type
DateTime. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
This method is similar to DateTimeOffset.ToUnixTimeMilliseconds
but is available even below .NET Framework 4.6.
If value is a Local time, then its Kind is converted to UTC first.
This method returns a negative value for times before 1970-01-01T00:00Z.