Quote:
|
Originally Posted by Bhups
need to get timestamp with millisecond in UNIX. Date command gives Year,month day, hour,minute and second but it does not give millisecond.
|
As I understand, you need a timestamp with millisecond precision.
Works with GNU date.
Code:
sh-2.05b$ cat bhups.ksh
#! /bin/ksh
epoch=$(date +%F-%l-%M-%S-)$(( $(date +%N) / 1000000 ))
echo $epoch
sh-2.05b$ ./bhups.ksh
2005-12-06- 4-22-35-195
vino