-
Notifications
You must be signed in to change notification settings - Fork 34
JQ pScheduler Library
This page describes
Calculates the number of seconds in an ISO 8601 duration.
value
- A string containing an ISO 8601 duration (e.g., P1W3DT9H
).
An integer (e.g., 896400
).
import "pscheduler/iso8601" as iso; iso::duration_as_seconds("PT1H2M3S")
-> 3723
Parses an ISO8601 timestamp into its component parts.
timestamp
- A string containing a valid ISO 8601 timestamp.
A JSON object containing the following pairs:
-
year
,month
,day
- The date. -
hour
,minute
,second
- If provided, the time of day. -
offset_hr
,offset_min
- If provided, the offset from UTC represented by the time in hours and minutes.
import "pscheduler/iso8601" as iso; iso::timestamp_parsed("2017-05-04T02:15:18-04:00")
-> {
"year": "2017",
"month": "05",
"day": "04",
"hour": "02",
"minute": "15",
"second": "18",
"offset_hr": "-04",
"offset_min": "00"
}
Converts a number or string containing a number and a [SI whole-unit prefix] https://www.nist.gov/pml/weights-and-measures/prefixes) to an integer value.
value
- A string containing the value to be converted (e.g., 500k
, 16Mi
or 22030
).
An integer (e.g., 896400
).
import "pscheduler/si" as si; si::as_integer("12ki")
-> 12288
import "pscheduler/si" as si; si::as_integer("12.34M")
-> 12340000
import "pscheduler/si" as si; si::as_integer(8675309)
-> 8675309