currentTimeStamp property

int get currentTimeStamp

Returns the current timestamp in seconds.

Example:

DateTime dateTime = DateTime.now();
int currentTimeStamp = dateTime.currentTimeStamp;
print('Current Timestamp: $currentTimeStamp');

Implementation

int get currentTimeStamp =>
    (DateTime.now().millisecondsSinceEpoch ~/ 1000).toInt();