ISO date uses year - month - day.
The nice thing about this is, that you easily grep it. Making lists of files
from a particular date. Correlating different files;
~$: ll *.html 4 -rw-r--r-- 1 rob rob 961 2023-04-14 11:19 404.html 4 -rw-r--r-- 1 rob rob 789 2022-08-16 11:56 bot.html 8 -rw-r--r-- 1 rob rob 6256 2023-10-11 12:07 index.html 4 -rw-r--r-- 1 rob rob 1851 2022-08-19 13:44 leiden.html 4 -rw-r--r-- 1 rob rob 1075 2022-08-19 13:44 privacy.html 8 -rw-r--r-- 1 rob rob 4455 2023-05-06 12:44 qr.html 96 -rw-r--r-- 1 rob rob 94953 2024-02-01 09:42 sitemap.html 4 -rw-r--r-- 1 rob rob 1064 2023-12-27 06:47 smtp-fw.html 8 -rw-r--r-- 1 rob rob 7477 2023-12-12 15:01 system.html
~$: ll *.html | grep 2024 96 -rw-r--r-- 1 rob rob 94953 2024-02-01 09:42 sitemap.html
This document describes how to enable ISO date.
Date and time may be separated by a space or a capital latter 'T';
YYYY-mm-dd HH:MM:SS YYYY-mm-ddTHH:MM:SS
These may come with optional milliseconds or microseconds and a time zone.
YYYY-mm-dd HH:MM:SS ±zzzz
A syslog example;
2024-02-01T11:11:05.410158+01:00
In /etc/analog.cfg;
Time stamp | Config |
---|---|
2024-02-01T11:11:05.410158+01:00 | %Y-%m-%dT%h:%n:%j |
[2024-02-01 11:14:55 +0100] | [%Y-%m-%d %h:%n:%j%w%j] |
2024-02-01T11:16:05.820 | %Y-%m-%dT%h:%n:%j |
2024-02-01 10:56:49 | %Y-%m-%d %h:%n:%j |
2024-02-01 11:05:14.345 +0100 | %Y-%m-%d %h:%n:%j%w%j |
[2024-02-01 11:14:55 +0100]
In '/etc/apache2/apache2.conf';
LogFormat "%v:%p %h %l %u %{[%Y-%m-%d %H:%M:%S %z]}t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %{[%Y-%m-%d %H:%M:%S %z]}t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %{[%Y-%m-%d %H:%M:%S %z]}t \"%r\" %>s %O" common
2024-02-01T11:16:05.820
In the logging section;
print-time iso8601;
In '~/.bashrc';
alias ll='ls -als --time-style=long-iso'
2024-02-01 11:05:14.345 +0100
In '/etc/squid/squid.conf';
logformat isodate %{%F %T}tl.%03tu %{%z}tl %6tr %>A %Ss/%03>Hs %<st %rm %ru %[un %Sh/%<a %mt
access_log daemon:/var/log/squid/access.log isodate