Hi Jon,
On 14/03/2024 16:48, jon wrote:
Michael - is this good to go??
Jon
On Mar 12, 2024, at 11:18 AM, jon jon.murphy@ipfire.org wrote:
Back when I was playing with NTP and tried to make it better in 2022 I thought it would have been helpful but it wasn’t my focus and I did not have the skills to add it. Recently there were mentions about adding date/time in the community. So it seemed like a good time to add (no pun intended).
Jon Murphy jon.murphy@ipfire.org
On Mar 12, 2024, at 5:10 AM, Michael Tremer michael.tremer@ipfire.org wrote:
Hello Jon,
What is the motivation for this patch?
-Michael
On 11 Mar 2024, at 23:45, Jon Murphy jon.murphy@ipfire.org wrote:
- added words and date-time format to english (en.pl)
- other languages are needed
- seconds included since time is accurate to < .1s
I think this could be an issue. The time might be accurate to 0.1 secs but it will only be updated when the browser page is refreshed. So I can imagine people saying that the clock is not working because the seconds haven't changed.
I have had that sort of problem in the past with the Connections Status page where people complained that the Connection expiry time was not updating unless they refreshed the browser page and they were sure it used to update every second in the past.
Certainly don't want to be ending up refreshing the browser page every second or less to show a change in the seconds value.
People will likely have a clock on the status panel of their OS desktop anyway so if the time matches on the hours and the minutes it will likely match the seconds as well.
Regards,
Adolf.
https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac45...
Code-by: Leo-Andres Hofmann hofmann@leo-andres.de Signed-off-by: Jon Murphy jon.murphy@ipfire.org
html/cgi-bin/time.cgi | 4 ++++ langs/en/cgi-bin/en.pl | 2 ++ 2 files changed, 6 insertions(+)
diff --git a/html/cgi-bin/time.cgi b/html/cgi-bin/time.cgi index 57a02a4b6..04c1e771f 100644 --- a/html/cgi-bin/time.cgi +++ b/html/cgi-bin/time.cgi @@ -287,6 +287,10 @@ print <<END
</table> END ; + +my $now = strftime($Lang::tr{'timeformat'}, localtime); +print "<hr>$Lang::tr{'system time'}: $now"; + &Header::closebox(); &Header::openbox('100%',1,$Lang::tr{'ntp sync'}); print <<END diff --git a/langs/en/cgi-bin/en.pl b/langs/en/cgi-bin/en.pl index 667fb5d7e..2e036adb3 100644 --- a/langs/en/cgi-bin/en.pl +++ b/langs/en/cgi-bin/en.pl @@ -2462,6 +2462,7 @@ 'system log viewer' => 'System Log Viewer', 'system logs' => 'System Logs', 'system status information' => 'System Status Information', +'system time' => 'System time (as of last page load)', 'ta key' => 'TLS-Authentification-Key', 'taa zombieload2' => 'TSX Async Abort/ZombieLoad v2', 'tcp more reliable' => 'TCP (more reliable)', @@ -2490,6 +2491,7 @@ 'time' => 'Time', 'time date manually reset' => 'Time/Date manually reset.', 'time server' => 'Time Server', +'timeformat' => '%Y-%m-%d at %H:%M:%S %Z', 'timeout must be a number' => 'Timeout must be a number.', 'title' => 'Title', 'to' => 'To', -- 2.30.2