https://github.com/knowledgecode/date-and-time
The simplest, most intuitive date and time library
https://github.com/knowledgecode/date-and-time
date duration format javascript parse time timezone typescript
Last synced: 4 days ago
JSON representation
The simplest, most intuitive date and time library
- Host: GitHub
- URL: https://github.com/knowledgecode/date-and-time
- Owner: knowledgecode
- License: mit
- Created: 2014-12-20T09:10:32.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2026-01-18T08:53:22.000Z (about 1 month ago)
- Last Synced: 2026-01-29T04:59:15.294Z (29 days ago)
- Topics: date, duration, format, javascript, parse, time, timezone, typescript
- Language: TypeScript
- Homepage: https://knowledgecode.github.io/date-and-time/
- Size: 1.79 MB
- Stars: 189
- Watchers: 4
- Forks: 42
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# date-and-time
[](https://github.com/knowledgecode/date-and-time/actions/workflows/test.yml)
[](https://github.com/knowledgecode/date-and-time/actions/workflows/test.yml)
[](https://www.npmjs.com/package/date-and-time)
The simplest, most intuitive date and time library.
## Installation
```shell
npm i date-and-time
```
- ES Modules:
```typescript
import { format } from 'date-and-time';
format(new Date(), 'ddd, MMM DD YYYY');
// => Wed, Jul 09 2025
```
- CommonJS:
```typescript
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](https://github.com/knowledgecode/date-and-time/blob/master/docs/migration.md).
## API
For comprehensive documentation and examples, visit: **[GitHub Pages](https://knowledgecode.github.io/date-and-time/)**
## License
MIT
## Contributing
Contributions are welcome! Please feel free to submit a Pull Request.