Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. void main() {
  2. var list = [
  3. DateTime.now().add(Duration(days: 3)),
  4. DateTime.now().add(Duration(days: 2)),
  5. DateTime.now(),
  6. DateTime.now().subtract(Duration(days: 1))
  7. ];
  8.  
  9. list.sort((a, b) => a.compareTo(b));
  10. print(list);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement