difference method

  1. @useResult
Duration difference(
  1. LocalDateTime other
)

Returns the difference between this and other.

LocalDateTime(22).difference(LocalDateTime(12)); // 10 hours

LocalDateTime(13).difference(LocalDateTime(23)); // -10 hours

Implementation

@useResult Duration difference(LocalDateTime other) => Duration(microseconds: epochMicroseconds - other.epochMicroseconds);