%s is the seconds %N is the nanoseconds %3N is the first 3 digits of the nanoseconds (doesn't work on all systems)So:
date '+%s%3N' If %3N works for youOtherwise:
$(( $(date +%s%N) / 1000000 ))By the way, to get the seconds since the start of the epoch (January 1, 1970):
date '+%s'