ModelTimestamp class

Define the field as a timestamp.

The base value is given as value. If not given, the current time is set.

By passing this to the server, the timestamp on the server side is stored as data.

フィールドをタイムスタンプとして定義します。

ベースの値をvalueとして与えます。与えられなかった場合現在時刻がセットされます。

これをサーバーに渡すことでサーバー側のタイムスタンプがデータとして保存されます。

Inheritance
Implemented types
Available Extensions
Annotations

Constructors

ModelTimestamp([DateTime? value])
Define the field as a timestamp.
const
factory
ModelTimestamp.dateTime(int year, [int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond])
Define the field as a timestamp.
const
factory
ModelTimestamp.fromJson(DynamicMap json)
Convert from json map to ModelTimestamp.
factory
ModelTimestamp.fromServer([DateTime? value])
Used to disguise the retrieval of data from the server.
const
factory
ModelTimestamp.now()
Define the field as a timestamp.
const
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
value DateTime
Actual value.
no setteroverride

Methods

compareTo(ModelTimestamp other) int
Compares this object to another object.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() DynamicMap
Methods for Json serialization.
override
toString() String
A string representation of this object.
override

Operators

operator <(ModelTimestamp other) bool
Compare with other ModelTimestamp.
operator <=(ModelTimestamp other) bool
Compare with other ModelTimestamp.
operator ==(Object other) bool
The equality operator.
override
operator >(ModelTimestamp other) bool
Compare with other ModelTimestamp.
operator >=(ModelTimestamp other) bool
Compare with other ModelTimestamp.

Constants

kNowKey → const String
A value key that should be set to true if the current time is used.
kSourceKey → const String
Key to store the data source.
kTimeKey → const String
Key to save time.
typeString → const String
Type key.