Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

269
Views
Convierta la marca de tiempo de Unix en hh: mm: ss: SSS (donde SSS es milisegundos) en AWK

¿Cómo puedo convertir la marca de tiempo de Unix a hh: mm: ss: SSS (donde SSS es milisegundos) en AWK?

Por ejemplo:

 echo 1456478048306 > time cat time | awk ....... > readable_time_format
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Puedes usar bash para eso:

 #!/bin/bash ts="1456478048306" unix_epoch=${ts:0:-3} ms=${ts:((-3)):3} echo "$(date -d@"${unix_epoch}" +%H:%M:%S):${ms}"

Por cierto, por supuesto, también puedes usar awk . Sin embargo, awk no permite simplificar mucho las cosas aquí, el algoritmo es más o menos el mismo:

 awk -v ts="1456478048306" '{ unix_epoch=substr(ts, 0, length(ts)-3) ms=substr(ts, length(ts)-2, 3) print strftime("%H:%M:%S", unix_epoch) ":" ms }'
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!