Optional
date: null | string | number | Date | DayjsThe input date, timestamp, or string to parse.
Optional
format: GetMomentFormatOptional format string to assist parsing.
Optional
settings: GetMomentSettingsOptional settings to control timezone or UTC output.
A dayjs
instance in local time, UTC, or the specified timezone.
utc
, timezone
, and customParseFormat
plugins (already preconfigured).utc
is true
, the timezone
setting is ignored.Basic output:
import { getMoment } from "@flightlesslabs/utils";
const basicTime = getMoment();
console.log(utcTime.format('DD-MM-YYYY)); // "01-02-2025"
Creates a
dayjs
instance with optional format parsing, timezone handling, or UTC output.This is a thin wrapper around
dayjs
that adds: