Skip to main content Link Menu Expand (external link) Document Search Copy Copied

DateFromUnixTime overview

Added in v0.5.0


Table of contents


DateFromUnixTimeC (interface)

Signature

export interface DateFromUnixTimeC extends t.Type<Date, number, unknown> {}

Added in v0.5.0

DateFromUnixTime

Signature

export const DateFromUnixTime: DateFromUnixTimeC = ...

Example

import { DateFromUnixTime } from 'io-ts-types/lib/DateFromUnixTime'
import { right } from 'fp-ts/lib/Either'

const date = new Date(1973, 10, 30)
const input = date.getTime() / 1000
assert.deepStrictEqual(DateFromUnixTime.decode(input), right(date))

Added in v0.5.0