DateTime.difference example doesn't take daylight-saving into account. #16527
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-core
type-documentation
A request to add or improve documentation
The DateTime.difference example currently is:
===
DateTime berlinWallFell = new DateTime(1989, DateTime.NOVEMBER, 9);
DateTime dDay = new DateTime(1944, DateTime.JUNE, 6);
Duration difference = berlinWallFell.difference(dDay);
assert(difference.inDays == 16592);
===
This won't work for Australia (where berlinWallFell would be in summer-time, and dDay in winter-time).
The comment should probably remind that differences on non-UTC date-times don't always yield what you expect.
The text was updated successfully, but these errors were encountered: