Search code snippets, questions, articles...

Get current timestamp in flutter or dart

To get the current timestamp in Flutter or dart you can use DateTime.now().millisecondsSinceEpoch.
var timestamp = DateTime.now().millisecondsSinceEpoch.toString()
print(timestamp);
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place.

Output

1643916528027
Was this helpful?
0 Comments