encode method

  1. @override
Object encode(
  1. DateTime self
)
override

Implementation

@override
Object encode(DateTime self) {
  return switch (encodingMode) {
    DateTimeEncoding.iso8601String => self.toIso8601String(),
    DateTimeEncoding.utcIso8601String => self.toUtc().toIso8601String(),
    DateTimeEncoding.millisSinceEpoc => self.millisecondsSinceEpoch
  };
}