diff options
author | Eric Wong <e@80x24.org> | 2021-10-19 09:33:45 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-10-19 17:29:22 +0000 |
commit | 05ba3513ab45618956739731e11c6e9cd8924bdc (patch) | |
tree | 63984d4c886f1edfb206f07662bc64470bd99315 /lib/PublicInbox/LeiInspect.pm | |
parent | 1f887bd51d92b0d4fea4d8e3c36f4328c6b0ae76 (diff) | |
download | public-inbox-05ba3513ab45618956739731e11c6e9cd8924bdc.tar.gz |
While inspect is intended for debugging, the Unix epoch in seconds requires extra steps for human consumption; just steal what we used for "lei q -f json" output.
Diffstat (limited to 'lib/PublicInbox/LeiInspect.pm')
-rw-r--r-- | lib/PublicInbox/LeiInspect.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/LeiInspect.pm b/lib/PublicInbox/LeiInspect.pm index 38ef3ad9..5ea32ccb 100644 --- a/lib/PublicInbox/LeiInspect.pm +++ b/lib/PublicInbox/LeiInspect.pm @@ -12,10 +12,15 @@ use parent qw(PublicInbox::IPC); use PublicInbox::Config; use PublicInbox::MID qw(mids); use PublicInbox::NetReader qw(imap_uri nntp_uri); +use POSIX qw(strftime); +use PublicInbox::LeiOverview; +*iso8601 = \&PublicInbox::LeiOverview::iso8601; sub _json_prep ($) { my ($smsg) = @_; $smsg->{$_} += 0 for qw(bytes lines); # integerize + $smsg->{dt} = iso8601($smsg->{ds}) if defined($smsg->{ds}); + $smsg->{rt} = iso8601($smsg->{ts}) if defined($smsg->{ts}); +{ %$smsg } # unbless and scalarize } |