GpsTime class

Represents a time value for GpsPoint and children.

Time is internally stored as UTC with accuracy level of 1 second, counted since the epoch (1970).

Constructors

GpsTime(int secondsSinceEpoch, {bool autoClamp = false})
Constructor.
GpsTime.fromDateTime(DateTime dateTime, {bool autoClamp = false})
Factory constructor from a DateTime object.
factory
GpsTime.fromMillisecondsSinceEpochUtc(int milliseconds, {bool autoClamp = false})
Factory constructor from number of milliseconds since the epoch.
factory
GpsTime.fromUtc(int year, {int month = 1, int day = 1, int hour = 0, int minute = 0, int second = 0, bool autoClamp = false})
Factory constructor from a UTC date specified by year and optionally month, day, hour, minute and second.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondsSinceEpoch int
Number of seconds sinds the epoch (UTC).
final

Methods

add({int days = 0, int hours = 0, int minutes = 0, int seconds = 0, bool autoClamp = false}) GpsTime
Returns a new GpsTime that is days, hours, minutes and seconds later than the current one.
compareTo(GpsTime other) TimeComparisonResult
Wrapper method for compareTime.
difference(GpsTime other) int
Calculates this - other and returns the outcome in seconds.
isAfter(GpsTime other) bool
Returns true if this is after other.
isBefore(GpsTime other) bool
Returns true if this is before other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDateTimeUtc() DateTime
Converts to a DateTime object, in UTC.
toString() String
A string representation of this object.
override

Operators

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

Static Properties

maxSecondsSinceEpoch int
Maximum allowed seconds since epoch, so that the value fits in an Uint32. The -1 is to allow the storage system to use that for null representations.
final
zero GpsTime
A quasi-constant zero GpsTime.
final

Constants

hoursPerDay → const int
minutesPerday → const int
minutesPerHour → const int
resolutionSeconds → const int
secondsPerDay → const int
secondsPerHour → const int
secondsPerMinute → const int