bash 5.0 natively supports retrieving seconds since Epoch using a variable.
If seconds are preferred:
If milliseconds are preferred:
In addition to using the native
date may be used.
According to the
%s seconds since the Epoch (1970-01-01 00:00 UTC)
If milliseconds seconds are preferred: