[date_time] missed some TZ stuff

pull/1161/merge
Tim Stack 9 months ago
parent 155dad6ee1
commit 3cc827d613

@ -8,7 +8,7 @@
"pattern": "^(?<timestamp>\\S{3,8} \\w{3}\\s+\\d{1,2} \\d{2}:\\d{2}:\\d{2} \\w+ \\d{4})\\s*(?<body>.*)$"
},
"sq-brackets": {
"pattern": "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3,6})?)Z?\\]\\s*(?<body>.*)$"
"pattern": "^\\[(?<timestamp>\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3,6})?(?:Z|[-+]\\d{2}:?\\d{2})?)\\]\\s*(?<body>.*)$"
}
},
"sample": [

@ -329,6 +329,7 @@ logfile_sub_source::text_value_for_line(textview_curses& tc,
= std::chrono::duration_cast<std::chrono::nanoseconds>(
std::chrono::microseconds{adjusted_time.tv_usec})
.count();
adjusted_tm.et_flags = format->lf_timestamp_flags;
len = format->lf_date_time.ftime(
buffer,
sizeof(buffer),

@ -34,7 +34,6 @@ TIME_FORMATS = \
"%a %b %d %H:%M:%S.%L " \
"%a %b %d %H:%M " \
"%a %b %e %H:%M:%S %Z %Y" \
"%d/%b/%Y:%H:%M:%S +0000" \
"%d/%b/%Y:%H:%M:%S %z" \
"%d-%b-%Y %H:%M:%S %z" \
"%d-%b-%Y %H:%M:%S %Z" \

@ -362,6 +362,8 @@ EXPECTED_FILES = \
$(srcdir)/%reldir%/test_logfile.sh_6602faf7817c494c33e32da7ee95f13aa9210d01.out \
$(srcdir)/%reldir%/test_logfile.sh_7c2e11488bccc59458b5775db4b90de964858259.err \
$(srcdir)/%reldir%/test_logfile.sh_7c2e11488bccc59458b5775db4b90de964858259.out \
$(srcdir)/%reldir%/test_logfile.sh_8a5e754cd471e5fdcdaede49c9290903acd7aad6.err \
$(srcdir)/%reldir%/test_logfile.sh_8a5e754cd471e5fdcdaede49c9290903acd7aad6.out \
$(srcdir)/%reldir%/test_logfile.sh_a7037efd0c4bbf51940137a44e57d94e9307e83e.err \
$(srcdir)/%reldir%/test_logfile.sh_a7037efd0c4bbf51940137a44e57d94e9307e83e.out \
$(srcdir)/%reldir%/test_logfile.sh_c18e14a26d8261c9f72747118a469266121d5459.err \

@ -0,0 +1,3 @@
Jul 20 15:59:26 2009 -- 000
Jul 20 15:59:29 2009 -- 000
Jul 20 15:59:29 2009 -- 000

@ -1,5 +1,6 @@
#! /bin/bash
export TZ=UTC
export YES_COLOR=1
export DUMP_CRASH=1

@ -39,6 +39,8 @@
#include "ptimec.hh"
static const char* GOOD_TIMES[] = {
"2023-08-11T00:59:36.208491Z",
"09/Aug/2023:21:41:44 +0000",
"2022-08-27T17:22:01.694554+03:00",
"2022-08-27T17:22:01.694554+0300",
"2022-08-27T17:22:01.694554+00:00",

@ -4,6 +4,7 @@ rm -rf events-home
mkdir -p events-home
export HOME=events-home
export YES_COLOR=1
export TZ=UTC
run_cap_test ${lnav_test} -n \
-c ';SELECT json(content) as content FROM lnav_events' \

@ -1,5 +1,6 @@
#! /bin/bash
export TZ=UTC
echo ${top_srcdir}
echo ${top_builddir}
@ -379,8 +380,6 @@ TCF 2014-04-06 11:01:11.475557: 0: <--- R 2 ["P1"] <eom>
EOF
# The TCSH format converts to local time, so we need to specify a TZ
export TZ="UTC"
run_test ./drive_logfile -t -f tcsh_history ${srcdir}/logfile_tcsh_history.0
check_output "TCSH timestamp interpreted incorrectly?" <<EOF
@ -398,6 +397,8 @@ Jul 20 22:59:29 2009 -- 000
Jul 20 22:59:29 2009 -- 000
EOF
run_cap_test env TZ=America/Los_Angeles ./drive_logfile -t -f access_log ${srcdir}/logfile_access_log.0
run_test ./drive_logfile -t -f generic_log ${srcdir}/logfile_tai64n.0
check_output "tai64n timestamps interpreted incorrectly?" <<EOF

@ -2,6 +2,7 @@
export YES_COLOR=1
export TZ=UTC
export HOME="./meta-sessions"
export XDG_CONFIG_HOME="./meta-sessions/.config"
rm -rf "./meta-sessions"

@ -1,5 +1,6 @@
#! /bin/bash
export TZ=UTC
export HOME="./sessions"
unset XDG_CONFIG_HOME
rm -rf "./sessions"

@ -1,5 +1,6 @@
#! /bin/bash
export TZ=UTC
export YES_COLOR=1
lnav_test="${top_builddir}/src/lnav-test"

@ -1,5 +1,6 @@
#! /bin/bash
export TZ=UTC
export YES_COLOR=1
# XXX sqlite reports different results for the "detail" column, so we

@ -1,5 +1,6 @@
#! /bin/bash
export TZ=UTC
export YES_COLOR=1
unset XDG_CONFIG_HOME

Loading…
Cancel
Save