Miss any of our Open RFC calls?Watch the recordings here! »

date-to-props

1.0.1 • Public • Published

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

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
}

Install

npm i date-to-props

DownloadsWeekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

3.69 kB

Total Files

6

Last publish

Collaborators

  • avatar