accurateConversion top-level constant

UnitConversion const accurateConversion

Accurate conversion scheme from different TimeUnits to microseconds.

This conversion scheme provides a more accurate conversion factors than casualConversion and is based on a 400-year calendar cycle.

Implementation

const UnitConversion accurateConversion = {
  TimeUnit.microsecond: 1,
  TimeUnit.millisecond: Duration.microsecondsPerMillisecond,
  TimeUnit.second: Duration.microsecondsPerSecond,
  TimeUnit.minute: Duration.microsecondsPerMinute,
  TimeUnit.hour: Duration.microsecondsPerHour,
  TimeUnit.day: Duration.microsecondsPerDay,
  TimeUnit.week: 7 * Duration.microsecondsPerDay,
  TimeUnit.month: _daysInMonth * Duration.microsecondsPerDay,
  TimeUnit.quarter: 3 * _daysInMonth * Duration.microsecondsPerDay,
  TimeUnit.year: _daysInYear * Duration.microsecondsPerDay,
  TimeUnit.decade: 10 * _daysInYear * Duration.microsecondsPerDay,
  TimeUnit.century: 100 * _daysInYear * Duration.microsecondsPerDay,
  TimeUnit.millennium: 1000 * _daysInYear * Duration.microsecondsPerDay,
};