https://github.com/andersdjohnson/date-to-props.js
Get simple properties from Date object.
https://github.com/andersdjohnson/date-to-props.js
Last synced: 3 months 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 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-02T23:34:06.000Z (over 5 years ago)
- Last Synced: 2025-03-12T21:14:39.064Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 2
- Watchers: 1
- 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
}
```