Reference
Timestamp
Now
| Output | A timestamp instance with the current local date and time. |
Signature
Example
To ISO
| Input | A timestamp instance. |
| Output | A string representation of the timestamp in ISO 8601 format. |
Signature
Example
From ISO
| Input | A string representation of a timestamp in ISO 8601 format. |
| Output | A timestamp instance. |
Signature
Example
Year
| Input | A timestamp instance. |
| Output | The year of the timestamp. |
Signature
Example
Month
| Input | A timestamp instance. |
| Output | The month of the timestamp (1-12). |
Signature
Example
Day
| Input | A timestamp instance. |
| Output | The day of the timestamp (1-31). |
Signature
Example
Hour
| Input | A timestamp instance. |
| Output | The hour of the timestamp (0-23). |
Signature
Example
Minute
| Input | A timestamp instance. |
| Output | The minute of the timestamp (0-59). |
Signature
Example
Second
| Input | A timestamp instance. |
| Output | The second of the timestamp (0-59). |
Signature
Example
Millisecond
| Input | A timestamp instance. |
| Output | The millisecond of the timestamp (0-999). |
Signature
Example
Compare
| Input | Two timestamp instances. |
| Output | 1 if the first timestamp is bigger than the second. -1 if it is the smaller. 0 if they are equal. |
Signature
Example
Add
| Input | A timestamp and a duration. |
| Output | A new timestamp with the duration added. |
Signature
Example
Subtract
| Input | A timestamp and a duration. |
| Output | A new timestamp with the duration subtracted. |
Signature
Example
Between
| Input | Two timestamps. |
| Output | The duration between the two timestamps. |
Signature
Example
Format
| Input | A timestamp and a format pattern string. |
| Output | A string representation of the timestamp in the specified format. |
Signature
Example
From Epoch
| Input | The number of milliseconds since the Unix epoch. |
| Output | A timestamp instance. |
Signature
Example
To Epoch
| Input | A timestamp instance. |
| Output | The number of milliseconds since the Unix epoch. |
Signature
Example
Day of Week
| Input | A timestamp instance. |
| Output | The day of the week (1-7, where 1 is Monday). |
Signature
Example
Day of Year
| Input | A timestamp instance. |
| Output | The day of the year (1-366). |
Signature
Example
Is After
| Input | Two timestamps. |
| Output | True if the first timestamp is after the second, false otherwise. |
Signature
Example
Is Before
| Input | Two timestamps. |
| Output | True if the first timestamp is before the second, false otherwise. |
Signature
Example
Is Leap Year
| Input | A year as a number. |
| Output | True if the year is a leap year, false otherwise. |
Signature
Example