Last active
July 15, 2019 21:55
-
-
Save kwalrath/39a574ebf877375b7a11905b135da3df to your computer and use it in GitHub Desktop.
Convert timestamp
This file contains hidden or 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
| // Say the timestamp in the Travis log looks like this: | |
| // | |
| // travis_time:end:22889f10:start=1559926540498807523,finish=1559926542012374871,duration=1513567348 | |
| // | |
| // This program prints the time in local and UTC time zones. | |
| main() { | |
| int build = (1559926542012374871.0/1e6).toInt(); | |
| var buildDateTime = DateTime.fromMillisecondsSinceEpoch(build); | |
| print('Local time: $buildDateTime'); | |
| print('UTC time: ${buildDateTime.toUtc()}'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment