flutter

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);

Output

1643916528027
Was this helpful?