epochDay property

int epochDay

Implementation

int get epochDay {
  var ms = ITime.millisecondsOf(timeSinceEpoch);
  var ns = ITime.nanosecondsIntervalOf(timeSinceEpoch);

  // todo: determine if there are other corner-cases here
  if (ms == 0 && ns < 0) return -1;
  var days = ms ~/ TimeConstants.millisecondsPerDay;
  if (ms < 0 && ms % TimeConstants.millisecondsPerDay != 0) return days - 1;

  return days;
}