A JavaScript date formatting utility inspired by Java's SimpleDateFormat. Version 1.0.8 provides pattern-based formatting with support for common date, time, and weekday components (e.g., dd, MMMM, yyyy, hh:mm:ss, a). It includes locale-aware month and weekday names in multiple languages (English, French, German, Simplified Chinese, Russian, Arabic, Japanese). The library is lightweight with no external dependencies. Last updated in 2021, it appears to be in maintenance mode with no recent updates. Compared to alternatives like date-fns or moment.js, dt-format offers a Java-like API but lacks extensive locale data and comprehensive documentation.
npm install dt-formatNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing DateTimeFormat and DateTimeLocale, formatting a date with a pattern, and using a German locale.
Always import DateTimeFormat as the class; do not rely on a DateFormat export.
Use dynamic import() in CommonJS or switch to ESM imports.
Specify locale explicitly if needed; do not assume en_US.
Consider migrating to actively maintained libraries like date-fns or dayjs.
Use named import: import { DateTimeFormat } from 'dt-format'Import DateTimeFormat and optionally assign it to var DateFormat = DateTimeFormat;
Use dynamic import('dt-format') or switch your project to ESM.No dependency data recorded yet.