Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

knowledgecode/date-and-time

Open more actions menu

Repository files navigation

date-and-time

date-and-time

CI Coverage npm

The simplest, most intuitive date and time library.

Installation

npm i date-and-time
  • ES Modules:
import { format } from 'date-and-time';

format(new Date(), 'ddd, MMM DD YYYY');
// => Wed, Jul 09 2025
  • CommonJS:
const { format } = require('date-and-time');

format(new Date(), 'ddd, MMM DD YYYY');
// => Wed, Jul 09 2025

Migration

Version 4.x has been completely rewritten in TypeScript and some features from 3.x are no longer compatible. The main changes are as follows:

  • The timezone and timespan plugins have been integrated into the main library
  • Tree shaking is now supported
  • Supports ES2021 and no longer supports older browsers

For details, please refer to migration.md.

API

For comprehensive documentation and examples, visit: GitHub Pages

License

MIT

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.