toString method
Returns a human-readable string for this instance.
The returned string is constructed for the time zone of this instance.
The toString()
method provides a simply formatted string.
The resulting string can be parsed back using parse,
Implementation
@override
String toString() {
var y = _fourDigits(year);
var m = _twoDigits(month);
var d = _twoDigits(day);
var h = _twoDigits(hour);
var min = _twoDigits(minute);
var sec = _twoDigits(second);
var ms = _threeDigits(millisecond);
var us = microsecond == 0 ? '' : _threeDigits(microsecond);
if (isUtc) {
return '$y-$m-$d $h:$min:$sec.$ms${us}Z';
} else {
return '$y-$m-$d $h:$min:$sec.$ms$us';
}
}