https://github.com/azer/english-time
Parses times written in simple English to unix time.
https://github.com/azer/english-time
Last synced: 11 months ago
JSON representation
Parses times written in simple English to unix time.
- Host: GitHub
- URL: https://github.com/azer/english-time
- Owner: azer
- Created: 2013-05-18T06:43:06.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2014-01-15T00:56:50.000Z (over 12 years ago)
- Last Synced: 2025-07-02T13:12:53.373Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 186 KB
- Stars: 87
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## english-time [](https://travis-ci.org/azer/english-time)
Parses times written in simple English to unix time.
```js
time = require('english-time')
time('314 milliseconds')
// => 314
time('5 minutes 15 seconds')
// => 315000
time('an hour and a minute')
// => 3660000
time('1 Hour, 5 Minutes And 15 Seconds')
// => 3915000
time('2h 15m 15s')
// => 3915000
time('3 weeks, 5 days, 6 hours')
// => 2268000000
time('3 weeks, 5d 6h')
// => 2268000000
```
See [List of Recognized Unit Aliases](#ref) and tests for more info.
## Install
```bash
$ npm install english-time
```
## List of Recognized Unit Aliases
**Milliseconds**
* ms
* millisec
* millisecs
* milliseconds
* millisecond
**Second(s)**
* s
* sec
* secs
* seconds
* second
**Minute(s)**
* m
* min
* mins
* minute
* minutes
**Hour(s)**
* h
* hour
* hours
**Day(s)**
* d
* day
* days
**Week(s)**
* w
* week
* weeks
**Month(s)**
* mo
* month
* months
**Year(s)**
* y
* year
* years
## Translations
* [turkish-time](http://github.com/azer/turkish-time)
* [kurdish-time](http://github.com/azer/kurdish-time)
## Tools & libraries based on english-time
* [shell-jobs](http://github.com/azer/shell-jobs)
* [after-time](http://github.com/azer/after-time)
* [run-after](http://github.com/azer/run-after)