Possible Solution
date --set="2011-12-07 01:20:15.962" && date --rfc-3339=ns
Original Question
I can get the date with milliseconds like so:
date +"%S.%N"
date --rfc-3339=ns
According to man date
I would expect to be able to set it like so:
date --set=%s.%N +`date +"%S.%N"`
date --set="%s.%N" "+1323217126.085882000"
According to my googling I would expect to be able to set the date like so (the inverse of the above):
date +%s.%N -s `date +"%S.%N"`
date +"%s.%N" -s "1323217126.085882000"
Neither work. Can someone clue me in on the issue?
P.S. No, I don't need nanosecond resolution. Yes, I know bash execution takes milliseconds. What I really need is sub-second resolution, 10ths of a second would be good enough.