# parseTimeFromUnix

Industry: Core

## Signature

```ts
parseTimeFromUnix(value: string | number, options?: { epochUnit?: UnixUnit; timeZone?: string; }): string
```

Extract the time portion from a unix epoch value.

- Converts to ZonedDateTime then extracts the PlainTime.
- Returns "" for invalid input.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `value` | `string` \| `number` | unix epoch in milliseconds or seconds: a safe integer, or a string of optionally negative ASCII digits |

## Options

**options**

optional: how `value` is read and the zone its wall clock is read in

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `epochUnit?` | `"seconds"` \| `"milliseconds"` \| `"second"` \| `"millisecond"` ([`UnixUnit`](/gmt/reference/types/UnixUnit/)) | `"milliseconds"` | The unit the epoch values are counted in: `"seconds"` or `"milliseconds"`, singular or plural. Any other value returns `""`. |
| `timeZone?` | `string` | `"UTC"` | The time zone the wall-clock fields are read in: an IANA name, a UTC offset (a time zone identifier such as `+05:30`, `+0530` or `-08`, or a stored offset `±HH:MM[:SS]`, what `getTimeZoneOffset` returns), or `"local"` for the system time zone. An unknown zone returns `""`. |

## Returns

ISO time string (e.g., "14:30:45") or "" on invalid input

## Related types

- [`UnixUnit`](/gmt/reference/types/UnixUnit/)

## Examples

```ts
import { parseTimeFromUnix } from "@northguild/gmt/unix/parse";

parseTimeFromUnix(1700000000000, { timeZone: "UTC" }) // "22:13:20"
```

## Source

[unix/parse/parseTimeFromUnix.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/unix/parse/parseTimeFromUnix.ts)
