Команда даты GNU date +%s.%N
выведет секунды, начиная с эпохи, примерно так:
1579339833.325517439
Чтобы преобразовать данную строку в формат, описанный выше в macOS bash, вы бы Пожалуйста, попробуйте следующее:
str="2020-01-17T07:41:53.000Z"
IFS=. read datetime millisec <<< "$str"
# split the string on "." into datetime and milliseconds
nanosec=$(( 10#${millisec%Z} * 1000000 ))
# remove trailing "Z" from the $millisec string
# then multiply by one million to convert to nanoseconds
printf "%s.%09d\n" $(date -d "${datetime}Z" +%s) "$nanosec"
# convert to "epoch" with the date command and append the nanosec
Надеюсь, это сработает.