CommonTime class

Constructors

CommonTime()

Properties

hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

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

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Static Methods

currentMillisecondsTimeStamp() → int
get unix milliseconds time stamp for current
currentTimeStamp() → int
get unix seconds time stamp for current
dateTimeToStr(DateTime dateTime, {Locale locale: defaultLocale, String strFormat: dateTimeFormat}) → String
DateTime convert to str default locale is en_US default format is yyyy-MM-dd HH:mm:ss
diffDays(DateTime a, DateTime b, [bool ignoreTime = false]) → int
compute different days between dateTime a and b
getStartAndEndTimeOfDay(DateTime dateTime) TimeStampOfDay
get the start and end unix time of the day
parseDateTimeStr(String strDateTime, {Locale locale: defaultLocale, String strFormat: dateTimeFormat}) → DateTime
parse time str to DataTime with local default locale is en_US eg. 2019-11-06 15:29:33
secondsToMediaTime(int seconds) → String
timeStampToStr(int timestamp, {Locale locale: defaultLocale, String strFormat: dateTimeFormat}) → String
unix time stamp convert to string time default locale is en_US default format is yyyy-MM-dd HH:mm:ss
timeStampToStrWrapped(int timestamp, {Locale locale: defaultLocale, String strFormat: dateTimeFormat}) → String
unix time stamp convert to wrapped str default locale is en_US default format is yyyy-MM-dd HH:mm:ss

Constants

dateFormat → const String
"yyyy-MM-dd"
dateTimeFormat → const String
"yyyy-MM-dd HH:mm:ss"
dateTimeFormat12Hours → const String
"yyyy-MM-dd hh:mm a"
defaultLocale → const Locale
const Locale('en', "US")
timeFormat → const String
"HH:mm:ss"