Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaelwp/js-parsing-date
https://github.com/michaelwp/js-parsing-date
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/michaelwp/js-parsing-date
- Owner: michaelwp
- License: mit
- Created: 2021-04-25T13:23:16.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-04-25T17:34:42.000Z (almost 4 years ago)
- Last Synced: 2024-08-10T19:03:31.241Z (6 months ago)
- Language: JavaScript
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# js-parsing-date
Ini adalah package nodejs sederhana untuk menghitung selisih dan detail antara dua tanggal.
### Contoh penggunaan
```javascript
const jsDate = require("./js-date");const jsDateObj = new jsDate(
"2021/04/01","2021/04/10"
)console.log(jsDateObj.difference().toMilliSeconds() + " milliseconds");
console.log(jsDateObj.difference().toSeconds() + " seconds");
console.log(jsDateObj.difference().toMinutes() + " minutes");
console.log(jsDateObj.difference().toHours() + " hours");
console.log(jsDateObj.difference().toDays() + " days");
console.log(jsDateObj.parsingDate());
```
#### Hasil
```text
777600000 milliseconds
777600 seconds
12960 minutes
216 hours
9 days
[ '2021/04/01',
'2021/04/02',
'2021/04/03',
'2021/04/04',
'2021/04/05',
'2021/04/06',
'2021/04/07',
'2021/04/08',
'2021/04/09',
'2021/04/10' ]
```