Method ToUnixTimestamp
ToUnixTimestamp(DateTime)
Converts the specified date & time into a double value that represents an equivalent Unix timestamp.
Declaration
public static double ToUnixTimestamp(this DateTime value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTime | value | The date & time to calculate the Unix timestamp for. |
Returns
| Type | Description |
|---|---|
| System.Double | A double containing the number of seconds since the Unix epoch. |
ToUnixTimestamp(DateTimeOffset)
Converts the specified System.DateTimeOffset into a double value that represents an equivalent Unix timestamp.
Declaration
public static double ToUnixTimestamp(this DateTimeOffset value)
Parameters
| Type | Name | Description |
|---|---|---|
| System.DateTimeOffset | value | The System.DateTimeOffset to calculate the Unix timestamp for. |
Returns
| Type | Description |
|---|---|
| System.Double | A double containing the number of seconds since the Unix epoch. |