RandomDateTime class

Random generator for Date time values.

Example

var value1 = RandomDateTime.nextDate( Date(2010,0,1));    // Possible result: 2008-01-03
var value2 = RandomDateTime.nextDateTime( Date(2017,0.1));// Possible result: 2007-03-11 11:20:32
var value3 = RandomDateTime.updateDateTime( Date(2010,1,2));// Possible result: 2010-02-05 11:33:23

Constructors

RandomDateTime()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

nextDate(DateTime min, [DateTime? max]) DateTime
Generates a random Date in the range 'min', 'max'. This method generate dates without time (or time set to 00:00:00)
nextDateTime(DateTime min, [DateTime? max]) DateTime
Generates a random Date and time in the range 'min', 'max'. This method generate dates without time (or time set to 00:00:00)
updateDateTime(DateTime value, [int? range]) DateTime
Updates (drifts) a Date value within specified range defined