UNPKG

@magicbell/core

Version:

Official MagicBell API wrapper

21 lines (20 loc) 653 B
import dayjs, { Dayjs } from 'dayjs'; /** * Function to build a Date given a number of seconds. * * @example secondsToDate(1582263571) */ export declare function secondsToDate(seconds: number | null): dayjs.Dayjs; /** * Function to build a Date given a string or number of milliseconds. * * @example toDate('2020-02-01') */ export declare function toDate(date: string | number | Dayjs | Date): dayjs.Dayjs; /** * Function to return a UNIX timestamp from a date representation. This value is * floored to the nearest second. * * @example toUnix('2020-10-06') */ export declare function toUnix(date?: string | number | Dayjs | Date): number;