Tarikh

Standard Formatting

Use standard, Bangla, or hybrid modes with the main formatter.

Standard Formatting

npm install @coreify/tarikh
import { format } from "@coreify/tarikh";

format(new Date(), { mode: "standard" });
// -> "31 Mar 2026"

format(new Date(), { mode: "standard", locale: "bn-BD" });
// -> "৩১ মার্চ ২০২৬"

format(new Date(), {
  mode: "standard",
  weekday: "long",
  hour: "2-digit",
  minute: "2-digit",
  second: "2-digit",
  hour12: true
});
// -> "Tuesday, 31 Mar 2026, 03:04:09 PM"

Bangla Formatting

format("2026-03-31", { mode: "bangla" });
// -> "17 Chaitra 1432"

format("2026-03-31", { mode: "bangla", locale: "bn-BD" });
// -> "১৭ই চৈত্র ১৪৩২"

Hybrid Formatting

Mix English and Bangla independently for the day, month, and year.

format(new Date(), { mode: "hybrid" });
// -> "31 মার্চ 2026"

format(new Date(), {
  mode: "hybrid",
  digits: "bn",
  month: "bn",
  year: "en"
});
// -> "৩১ মার্চ 2026"

Options

  • locale: "en-BD" or "bn-BD"
  • month: "short" or "long"
  • year: "numeric" or "2-digit"
  • day: "numeric" or "2-digit"
  • weekday: "short" or "long"
  • hour, minute, second: "numeric" or "2-digit"
  • hour12: boolean

format() is the recommended entry point. Use token patterns when you need exact output control.

On this page