Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/entsoe_api_client/src/helpers/duration.ts>ISO8601DurToSec

ENTSO-e transparency platform API Client built for Deno. Complete. Easy to use. Minimal.
Latest
variable ISO8601DurToSec
import { ISO8601DurToSec } from "https://deno.land/x/entsoe_api_client@1.0.1/src/helpers/duration.ts";

Helper function which parses an ISO8601 duration

Supports all time parts, negative values and decimals, example: PT1.5D1H5M1S

Do currently NOT support the date-part of ISO8601 durations at the moment. Throws when supplied with date-part, example: P1M1D

Has internal shortcuts for common durations (e.g. PT60M, PT30M etc.), to increase performance.

Throws on any type of parsing error.

Maninly intended for internal use in this library.

type

(pt: string) => unknown