Skip to content

Instantly share code, notes, and snippets.

@misterfourtytwo
Last active July 24, 2020 08:46
Show Gist options
  • Save misterfourtytwo/d918c83e1af4b53d7416878b701b8b97 to your computer and use it in GitHub Desktop.
Save misterfourtytwo/d918c83e1af4b53d7416878b701b8b97 to your computer and use it in GitHub Desktop.
dateTime difference
void main() {
// subtract later date from previous for positive values
DateTime a = DateTime(0, 1);
DateTime b = DateTime(0, 2);
print(b.difference(a).inDays);
print(a.difference(b).inDays);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment