random-datetime

1.0.1 • Public • Published

random-datetime

Generate a random date.

MIT License

build:? coverage:?

Install

$ npm install --save random-datetime

Usage

var randomDate = require('random-datetime');
 
// API
// - randomDate([options]);
 
// options
// - year
// - month
// - day
// - hour
// - minute
// - second
// - millisecond

By default, returns an actual Date object:

randomDate();
// => Tue Jun 11 5399 18:47:58 GMT+0800 (CST)

Can optionally specify defaults for any of year, month, day, hour, minute, second or millisecond:

randomDate({
    year: 2004,
    month: 4
});
// => Wed Apr 21 2004 10:12:33 GMT+0800 (CST)

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Package Sidebar

Install

npm i random-datetime

Weekly Downloads

170

Version

1.0.1

License

MIT

Last publish

Collaborators

  • bubkoo