date-and-time

The simplest, most intuitive date and time library

date-and-time downloads date-and-time version date-and-time license

date-and-timeSimilar Packages:
Npm Package Weekly Downloads Trend
3 Years
🌟 Show real-time usage chart on date-and-time's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of date-and-time](https://npm-compare.com/img/npm-trend/THREE_YEARS/date-and-time.png)](https://npm-compare.com/date-and-time#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 Show GitHub stars trend chart on date-and-time's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of date-and-time](https://npm-compare.com/img/github-trend/date-and-time.png)](https://npm-compare.com/date-and-time)
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
date-and-time375,156189250 kB0a month agoMIT
README for date-and-time

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.