Created
March 31, 2020 15:58
-
-
Save butlermatt/7318e557994ec2778919284ed10bdf0e to your computer and use it in GitHub Desktop.
Converts: hours; minutes; seconds, into milliseconds since midnight.
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() { | |
print(fromTime(13, 30)); | |
} | |
int fromTime(int hours, [int minutes = 0, int seconds = 0]) { | |
var tot = hours * 60 * 60; | |
tot += (minutes * 60); | |
tot += seconds; | |
return tot * 1000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment