DisplayUnixTimeStamp Method |
Returns the number of seconds since the Unix Epoch
Namespace: MomentSharpAssembly: MomentSharp (in MomentSharp.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax public static int UnixTimeStamp(
this DateTime dateTime,
string timeZoneId = "UTC"
)
<ExtensionAttribute>
Public Shared Function UnixTimeStamp (
dateTime As DateTime,
Optional timeZoneId As String = "UTC"
) As Integer
public:
[ExtensionAttribute]
static int UnixTimeStamp(
DateTime dateTime,
String^ timeZoneId = L"UTC"
)
[<ExtensionAttribute>]
static member UnixTimeStamp :
dateTime : DateTime *
?timeZoneId : string
(* Defaults:
let _timeZoneId = defaultArg timeZoneId "UTC"
*)
-> int
Parameters
- dateTime
- Type: SystemDateTime
this DateTime - timeZoneId (Optional)
- Type: SystemString
Defaults to UTC if not provided. For valid parameters see TimeZoneInfo.GetSystemTimeZones()
Return Value
Type:
Int32number of seconds since the Unix Epoch
Usage Note
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).
See Also