Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andersdjohnson/date-to-props.js
Get simple properties from Date object.
https://github.com/andersdjohnson/date-to-props.js
Last synced: 16 days ago
JSON representation
Get simple properties from Date object.
- Host: GitHub
- URL: https://github.com/andersdjohnson/date-to-props.js
- Owner: AndersDJohnson
- License: isc
- Created: 2015-03-07T20:47:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-04-02T23:34:06.000Z (over 4 years ago)
- Last Synced: 2024-10-11T16:27:22.160Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# date-to-props.js
Get simple properties from Date object.
## Install
Node
```
npm install --save date-to-props
```Bower (AMD, Global)
```
bower install --save date-to-props
```## Use
```js
var dateToProps = require('date-to-props');var date = new Date();
var props = dateToProps(date);// props is now something like:
{
date: 7,
day: 6,
fullYear: 2015,
hours: 19,
milliseconds: 707,
minutes: 59,
month: 2,
seconds: 34,
time: 1425779974707,
timezoneOffset: 360,
UTCDate: 8,
UTCDay: 0,
UTCFullYear: 2015,
UTCHours: 1,
UTCMilliseconds: 707,
UTCMinutes: 59,
UTCMonth: 2,
UTCSeconds: 34,
year: 115
}
```