Time - script API
StackState Self-hosted v5.0.x
This page describes StackState version 5.0.
The Time API offers helper functions to manipulate with time type in StackState scripts.
Function: Time.currentTimeSlice()
Time.currentTimeSlice()
Returns a time slice for the current timestamp
Examples
Function: Time.format(instant: Instant, pattern: String)
Time.format(instant: Instant, pattern: String)
Format an instant to string using the given formatting pattern
Args
instant
- an instant type representation.pattern
- Java date formatting pattern
Examples
Format an instant to ISO 8601 time
Function: Time.epochMs(instant: Instant)
Time.epochMs(instant: Instant)
Args
instant
- an instant type representation.
Examples
Convert a string timestamp to epoch
Last updated