Date.from_millis
Date.from_millis
Function
Creates a new Date object from a Unix timestamp in milliseconds.
Syntax
date_value.from_millis(millis)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| millis | Int | Yes | None | Unix timestamp in milliseconds. |
Return value
| Type | Description |
|---|---|
| Date | Returns a Date object corresponding to local time. |
Code Example
result = date().from_millis(1000).timestamp() // Output: 1
Notes
- The original Date object will not be modified, this method returns a new Date object.
- An error will be reported when the millisecond timestamp cannot be converted to local time.