@utiln/dates
v1.0.2
Published
Date helpers for the @utiln library
Readme
@utiln/dates
Lightweight date formatting helpers.
Install
npm install @utiln/datesUsage
import { formatToday, formatDateTime } from '@utiln/dates';
formatToday(); // "2026-08-18"
formatDateTime(new Date()); // "2026-08-18 08:30:00"API
| Export | Parameters | Returns | Description |
|--------|------------|---------|-------------|
| formatToday | — | string | Returns the current date as YYYY-MM-DD |
| formatDateTime | date: Date | string | Returns a date as YYYY-MM-DD HH:mm:ss |
formatDateTime throws when the provided date is invalid.
Requirements
- Node.js 22+
- ESM (
"type": "module")
