Skip to content

Instantly share code, notes, and snippets.

@Insayt
Forked from ar2rsoft/format-timestamp.sh
Created February 2, 2021 10:37
Show Gist options
  • Save Insayt/476a3ada8461777049260ce9978853a0 to your computer and use it in GitHub Desktop.
Save Insayt/476a3ada8461777049260ce9978853a0 to your computer and use it in GitHub Desktop.
# Если в логи пишется таймштамп, то при выводе логов не очень удобно - пример ниже, как можно отформатировать дату
cat file.log|perl -pe'use POSIX qw(strftime);s/^\[(\d+)\]/strftime("%Y-%m-%d %H:%M:%S",localtime $1\/1000)/e'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment