Class Int64Extensions
Extension methods for long.
Inherited Members
Namespace: GlitchedPolygons.ExtensionMethods
Assembly: GlitchedPolygons.ExtensionMethods.dll
Syntax
public static class Int64Extensions
Methods
BytesToFileSizeString(long)
Gets the passed fileSizeInBytes as a human readable file size string (e.g. "5 KB" or "20 MB").
Declaration
public static string BytesToFileSizeString(this long fileSizeInBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| long | fileSizeInBytes | The bytes (for example a file whose size you want to convert into a human readable string). |
Returns
| Type | Description |
|---|---|
| string | A human readable file size |
ExcelColumnNumberToName(long)
Converts an excel column number such as 28 to its equivalent column address name (in the case of 28 for example that would be "AB").
Declaration
public static string ExcelColumnNumberToName(this long columnNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| long | columnNumber | Column number to convert to Excel column address string format. |
Returns
| Type | Description |
|---|---|
| string | Column address/name, e.g. "A", "B", "C", "AB", etc... |
FromUnixTimeMilliseconds(long)
Converts a Unix timestamp (milliseconds since 1970-01-01 00:00:00.000 UTC) to a DateTime (in UTC).
Declaration
public static DateTime FromUnixTimeMilliseconds(this long timestamp)
Parameters
| Type | Name | Description |
|---|---|---|
| long | timestamp | The Unix timestamp to convert. |
Returns
| Type | Description |
|---|---|
| DateTime | The converted DateTime in UTC. |
FromUnixTimeSeconds(long)
Converts a Unix timestamp (seconds since 1970-01-01T00:00:00Z) to a UTC DateTime.
Declaration
public static DateTime FromUnixTimeSeconds(this long timestamp)
Parameters
| Type | Name | Description |
|---|---|---|
| long | timestamp | The Unix timestamp to convert. |
Returns
| Type | Description |
|---|---|
| DateTime | The converted DateTime in UTC. |