PDA

View Full Version : Why doesn't knoppix give you nanoseconds?



Albretch
10-21-2006, 03:05 PM
if you try:
.
sh-3.00# date -u -d today +%Y%m%d:%H:%M:%S:%N
.
you will see something like:
.
20061021:13:50:30:000000000
.
Is this a knoppix or Debian config thing?
.
I don't think it is a hw problem because if you can get the nanoseconds from the internal clock via:
.
sh-3.00# hwclock --utc
Sat Oct 21 05:54:20 2006 -0.053462 seconds
.
Is there a way to get `date` to print the nanoseconds or some other utility that does it or a nice/robust hack?
.
Thanx

WaKa
10-22-2006, 06:44 AM
This would work, however, is it accurate? :shock:
Nanoseconds here does not like the added '-d today' option see the next one.
sh-3.00# date -u -d today +%Y%m%d:%H:%M:%S && date -u +%N
20061021:22:13:47
706249000

sh-3.00# date -u +%Y%m%d:%H:%M:%S:%N
20061021:22:27:11:877563000

Although the latest shell works (5.0.1)

sh-3.1# date -u -d today +%Y%m%d:%H:%M:%S:%N
20061021:22:20:34:916246000