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
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    1
  • 1.0.0
    0

Package Sidebar

Install

npm i date-to-props

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

3.69 kB

Total Files

6

Last publish

Collaborators

  • adjohnson916