# absDuration

Industry: Core

## Signature

```ts
absDuration(value: string): string
```

Return the absolute value of an ISO 8601 duration string.

- Uses Temporal.Duration.from and .abs, then .toString() to re-emit.
- Like `negateDuration`, this only touches signs, so it never needs `relativeTo` and works on calendar-unit durations.
- An already-positive duration is returned re-emitted, not rejected — but re-emitted means canonicalized, so "P0D" comes back as "PT0S".
- Returns "" when `value` is not a valid ISO 8601 duration string.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` | ISO 8601 duration string |

## Returns

ISO 8601 duration string with a positive sign, or "" on invalid input

## Examples

```ts
import { absDuration } from "@northguild/gmt/duration/calculate";

absDuration("-P1DT2H") // "P1DT2H"
```

## Source

[duration/calculate/absDuration.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/duration/calculate/absDuration.ts)
