Closed tatsuyafujisaki closed 3 years ago
I have found the root cause and the solution.
Inside getFriendlyDateString(...)
, changing
long localDate = getLocalMidnightFromNormalizedUtcDate(normalizedUtcMidnight);
long daysFromEpochToProvidedDate = elapsedDaysSinceEpoch(localDate);
to
long localDate = normalizedUtcMidnight;
long daysFromEpochToProvidedDate = elapsedDaysSinceEpoch(localDate);
will solve the problem. This is because elapsedDaysSinceEpoch(...)
expects a UTC date rather than a local date as follows.
private static long elapsedDaysSinceEpoch(long utcDate) {
return TimeUnit.MILLISECONDS.toDays(utcDate);
}
Great thanks
Hello,
I have found a minor issue in S11.02-Solution-TodayListItem on the
student
branch.Running the project at noon on September 21 in Japan, September 22 is marked with "Today" in error.
The error seems to originate from
getFriendlyDateString()
but I'm not 100% sure if the error is caused by time zone difference.