formatted timestamp correctly

This commit is contained in:
celso 2023-03-31 01:54:37 -03:00
parent f26401ec1f
commit a899fc0917
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ getcbk_data() {
gettimestamp() {
local timestamp="$(tail -n 1 "${bot_tmpdir}${1}"\
| grep "\"date\"" | grep -om1 "\"date\":[0-9]\+,")"
[ ! -z "${timestamp}" ] && printf "%s" "${timestamp:7:-1}"
[ ! -z "${timestamp}" ] && date "+%D %H:%M" -d "@${timestamp:7:-1}"
}
# $1 is name of a bash array with the number of columns in every row such as ( 1 1 3 ) for a 3 row keyboard in which the first and second row have 1 column, and the third has 3