From fac92aefbc1ffbf37167e82b62627e2e418183f7 Mon Sep 17 00:00:00 2001 From: pezcurrel Date: Tue, 2 Jan 2024 00:44:23 +0100 Subject: [PATCH] Added gracetime in human readable form, graceline too, and graceminfreq --- web/clitools/graceline.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web/clitools/graceline.php b/web/clitools/graceline.php index 3e3ed48..a4139c8 100755 --- a/web/clitools/graceline.php +++ b/web/clitools/graceline.php @@ -17,10 +17,9 @@ */ const N="\n"; -require __DIR__.'/../lib/gracetime.php'; -$bti=round(microtime(true)); -$graceline=gmmktime(0,0,0,gmdate('n',$bti),gmdate('j',$bti),gmdate('Y',$bti))-$gracetime; -echo $graceline.N; +require __DIR__.'/../lib/ght.php'; +require __DIR__.'/../lib/grace.php'; +echo 'gracetime: '.$gracetime.' seconds ('.ght($gracetime,null,0,'days').')'.N.'graceline: '.$graceline.' ('.gmdate('Y-m-d H:i:s',$graceline).' UTC)'.N.'graceminfreq: '.$graceminfreq.' seconds ('.ght($graceminfreq,null,0,'days').')'.N; exit(0); ?>