Last active
January 4, 2023 19:37
-
-
Save jlamimoso/c72fc275f3e631cb3cd857cbc1a4e847 to your computer and use it in GitHub Desktop.
Dart program to get date from timestamp
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
import 'dart:convert'; | |
void main() { | |
testeDate(); | |
} | |
void testeDate() { | |
var ts = DateTime.now().millisecondsSinceEpoch; | |
var d = DateTime.fromMillisecondsSinceEpoch(ts); | |
print('dia: ${d.day} hora: ${d.hour}:${d.minute}:${d.second}'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment