DT class

Time Helper Class

Constructors

DT()

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

add(DateTime dateTime, TimeUnitDuration tud) → DateTime
Adds a TimeUnitDuration to a DateTime
ceil(DateTime dateTime, TimeUnit tu) → DateTime
Rounds the DateTime to the closest future TimeUnitDuration
floor(DateTime dateTime, TimeUnit tu) → DateTime
Rounds the DateTime to the closest past TimeUnitDuration
formatDateTime(DateTime datetime, String outputFormat) → String
Formats a DateTime into a String
formatString(String datetime, String inputFormat, String outputFormat) → String
Formats a date/time string
getTUDurationFromString(String str) → TimeUnitDuration
Given a string such as '100ms' or '10 years' this function returns a TimeUnitDuration object
isAfter(DateTime a, DateTime b) → bool
Compare if DateTime a is after DateTime b
isBefore(DateTime a, DateTime b) → bool
Compare if DateTime a is before DateTime b
isSame(DateTime a, DateTime b) → bool
Compare if DateTime a the same as DateTime b
isSameOrAfter(DateTime a, DateTime b) → bool
Compare if DateTime a is after DateTime b or the same
isSameOrBefore(DateTime a, DateTime b) → bool
Compare if DateTime a is before DateTime b or the same
subtract(DateTime dateTime, TimeUnitDuration tud) → DateTime
Subtracts a TimeUnitDuration from a DateTime
timeBetween(DateTime a, DateTime b) → String
Returns a human readable string of the time between 2 DateTimes ex: '1 minute ago' or 'in 2 days'