Last active
June 8, 2018 18:19
-
-
Save Noisytoot/27f4fe8d2cd11b04ddaa910da7053f77 to your computer and use it in GitHub Desktop.
Time
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() { | |
DateTime time = new DateTime.now(); | |
print("Time: $time"); | |
print("Time Zone: ${time.timeZoneName}"); | |
print("UTC Time: ${time.toUtc()}"); | |
print("Year: ${time.year}"); | |
print("Month: ${time.month}"); | |
print("Day: ${time.day}"); | |
print("Hour: ${time.hour}"); | |
print("Minute: ${time.minute}"); | |
print("Second: ${time.second}"); | |
print("Millisecond: ${time.millisecond}"); | |
print("Microsecond: ${time.microsecond}"); | |
print("Milliseconds since epoch: ${time.millisecondsSinceEpoch}"); | |
print("Microseconds since epoch: ${time.microsecondsSinceEpoch}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment