convert microseconds into hours munites and seconds using awk.

how can i convert a long int value(time in microseconds) into hours munites and seconds using awk.
techassAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ozoConnect With a Mentor Commented:
awk '{$1=sprintf("%02d:%02d:%02d.%03d",$1/3600000000,$1/60000000%60,$1/1000000%60,$1/1000%1000); print}'

0
 
ozoCommented:
awk '{printf"%02d:%02d:%02d\n",$1/3600000000,$1/60000000%60,$1/1000000%60}'
0
 
techassAuthor Commented:
yes but if also I could convert the time in mks into hh:mm:ss.ms (where ms is miliseconds ). Also I need to print other columns too. $2, $3.. so on.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.