]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
time.cgi: add current date-time to this WebGUI page
authorJon Murphy <jon.murphy@ipfire.org>
Mon, 11 Mar 2024 23:45:00 +0000 (18:45 -0500)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Mar 2024 18:45:17 +0000 (18:45 +0000)
- added words and date-time format to english (en.pl)
- other languages are needed
- seconds included since time is accurate to < .1s
https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=2234e8aacac2e0d0b06dac4513585c15c2b3b440

Code-by: Leo-Andres Hofmann <hofmann@leo-andres.de>
Signed-off-by: Jon Murphy <jon.murphy@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/time.cgi
langs/en/cgi-bin/en.pl

index 57a02a4b630b55ba7d0f6d0e3f8187093d0fedfa..04c1e771f792e8f178f0602b7911facafc66d51f 100644 (file)
@@ -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
index 667fb5d7ee7488325d3126027ad682bacfef7244..2e036adb382aa3362da4ae9db73101eece632dc9 100644 (file)
 '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)',
 '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',