Programming Tips - How can I get the millisecond since the epoch?

Date: 2017may10 OS: Linux Language: bash Q. How can I get the millisecond since the epoch? A. Use the + option of the date command.
%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 you
Otherwise:
$(( $(date +%s%N) / 1000000 ))