Created
April 20, 2022 02:47
-
-
Save mernen/e792348559e89e20fdf338aa98690cef to your computer and use it in GitHub Desktop.
Dart Duration.toString() demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
// Expected: -0:00:00.000123 | |
// Actual: 0:00:00.000123 | |
print(Duration(microseconds: -123)); | |
// Expected: -0:30:00.000000 | |
// Actual: 0:30:00.000000 | |
print(Duration(minutes: -30)); | |
// Expected: -1:00:00.000000 | |
// Actual: -1:00.00.00-0.0 (JS/DartPad only) | |
print(Duration(hours: -1)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment