Router: RT-AC88U
Firmware: 386.5_2
I found this little issue when checking spdMerlin's log.
The UTC time is printed instead of the local time. So, I went to the system log and found the following snippet
Using either UTC or local time could be a choice for developers of any software, e.g. `transmission` uses UTC all the time.
But it is not reasonable to use both UTC and local time for one software. For instance, `spdMerlin` prints its log with both local and UTC time. Till now, I used to think that there might be something wrong with the implementation of `spdMerlin`. Then I searched the source code of `spdMerlin`, trying to found how it prints time:
The developer uses
to print local time. Reference: how to get local date/time in linux terminal while server configured in UTC/different timezone?
So, why does `spdMerlin` still prints UTC time?
Further, I tested this issue in the console.
Interesting, the `date` command can only print UTC time. Is there any difference between the Merlin's and other unix-like systems' `date` command?
The answer is `NO` refer to the help info of Merlin's `date`. It says the `-u,--utc` option is used for UTC time. Local time should be printed when using default `date` command.
This simple test shows that the function of Merlin's `date` command is improper. Should this be improved/fixed?
Firmware: 386.5_2
I found this little issue when checking spdMerlin's log.
Code:
AutoBW report - Fri Jun 10 10:12:48 2022
Calculated Download speed (31562 Kbps) does not exceed 10% threshold of existing value (31659 Kbps)
Calculated Upload speed (17379 Kbps) does not exceed 10% threshold of existing value (17695 Kbps)
No changes made to QoS by AutoBW
Code:
Jun 10 10:27:00 transmission-daemon[5909]: Fantastic.Beasts.The.Secrets.of.Dumbledore.2022.2160p.MA.WEB-DL.DDP5.1.Atmos.HDR.HEVC-CMRG.mkv Tracker error: "Tracker gave HTTP response code 502 (Bad Gateway)" (torrent.c:623)
Jun 10 19:45:10 syslog: wlceventd_proc_event(527): eth2: Auth 48:01:C5:66:15:B3, status: Successful (0), rssi:0
Jun 10 19:45:10 syslog: wlceventd_proc_event(556): eth2: Assoc 48:01:C5:66:15:B3, status: Successful (0), rssi:0
Jun 10 19:45:11 dnsmasq-dhcp[429]: DHCPREQUEST(br0) 192.168.50.125 48:01:c5:66:15:b3
Jun 10 19:45:11 dnsmasq-dhcp[429]: DHCPACK(br0) 192.168.50.125 48:01:c5:66:15:b3 OnePlus7T
Jun 10 11:11:05 transmission-daemon[5909]: Unable to create session lock file (22): Invalid argument (session-id.c:96)
Jun 10 20:12:02 spdMerlin: Starting speedtest using auto-selected server for WAN interface
Jun 10 11:12:30 spdMerlin: Speedtest results - Download: 32.20 Mbps (data used: 40.1 MB) - Upload: 17.71 Mbps (data used: 20.9 MB)
Jun 10 11:12:30 spdMerlin: Connection quality - Latency: 5.63 ms (0.23 ms jitter) - Packet Loss: 0.0%
Jun 10 11:12:31 spdMerlin: Retrieving data for WebUI charts
Jun 10 11:12:44 spdMerlin: Calculated Download speed (31392 Kbps) does not exceed 10% threshold of existing value (31659 Kbps)
Jun 10 11:12:44 spdMerlin: Calculated Upload speed (17383 Kbps) does not exceed 10% threshold of existing value (17695 Kbps)
But it is not reasonable to use both UTC and local time for one software. For instance, `spdMerlin` prints its log with both local and UTC time. Till now, I used to think that there might be something wrong with the implementation of `spdMerlin`. Then I searched the source code of `spdMerlin`, trying to found how it prints time:
Code:
TZ=$(cat /etc/TZ)
export TZ
printf "AutoBW report - %s\\n\\n" "$(date +"%c")" > "$autobwoutfile"
Code:
TZ=<timezone> date
So, why does `spdMerlin` still prints UTC time?
Further, I tested this issue in the console.
Code:
$ date
Fri Jun 10 11:47:37 UTC 2022
$ date -u
Fri Jun 10 11:47:52 UTC 2022
$ TZ=$(cat /etc/TZ)
$ echo $TZ
JST
$ date
Fri Jun 10 11:48:11 UTC 2022
Code:
$ date --help
BusyBox v1.25.1 (2022-03-25 10:23:25 EDT) multi-call binary.
Usage: date [OPTIONS] [+FMT] [TIME]
Display time (using +FMT), or set time
[-s,--set] TIME Set time to TIME
-u,--utc Work in UTC (don't convert to local time)
-R,--rfc-2822 Output RFC-2822 compliant date string
-I[SPEC] Output ISO-8601 compliant date string
SPEC='date' (default) for date only,
'hours', 'minutes', or 'seconds' for date and
time to the indicated precision
-r,--reference FILE Display last modification time of FILE
-d,--date TIME Display TIME, not 'now'
-D FMT Use FMT for -d TIME conversion
Recognized TIME formats:
hh:mm[:ss]
[YYYY.]MM.DD-hh:mm[:ss]
YYYY-MM-DD hh:mm[:ss]
[[[[[YY]YY]MM]DD]hh]mm[.ss]
'date TIME' form accepts MMDDhhmm[[YY]YY][.ss] instead
This simple test shows that the function of Merlin's `date` command is improper. Should this be improved/fixed?