Optionaldate: null | string | number | Date | DayjsThe input date, timestamp, or string to parse.
Optionalformat: GetMomentFormatOptional format string to assist parsing.
Optionalsettings: 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
dayjsinstance with optional format parsing, timezone handling, or UTC output.This is a thin wrapper around
dayjsthat adds: