1.0.1 • Published 8 years ago

random-datetime v1.0.1

Weekly downloads
520
License
MIT
Repository
github
Last release
8 years ago

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.