- Only 2075w 4d 20h 3m 33s (14529.84 days) since Thu 31 Jan 1980 00:00:00
Commands: /since
or /until
or /sincegmt
or /untilgmt
Parameters: <date>
or <time>
or <date time>
or <time date>
Examples: ...
/since Tuesday, January 31, 1980 00:00:00
/since Jan 31st 80 12:00 am
/since 01 Jan 01:23 1980 pm
/since 1980 01:23:45 01 pm Jan
/since 31/01/1980
(or) 1980/01/31 12:34:56
/since 31-01-1980
(or) 12:34:56 1980-01-31 pm
/since 5:00 pm
(or) /until 5:00 pm
/sincegmt 5:00 pm
(or) /untilgmt 5:00 pm
st
nd
rd
th
are gracefully ignored./since
and /until
are exactly the same alias, past and future are calculated by math./sincegmt
and /untilgmt
will treat the specified date/time as GMT aka UTC.; /until 25/12/2019 /since 2 Nov 2016 /untilgmt 5:00 pm /sincegmt 1/1/2020 0:0:0
until {
var %gmt = 0
if ($1 == gmt) { var %gmt = 1 | tokenize 32 $2- }
if ($regex($1-,/^[0-9:apm. ]+$/i)) { tokenize 32 $date $1- }
var %then = $ctime($1-)
if (!%then) { echo -atic notice * Invalid date/time $chr(31) $+ $1- $+ $chr(31) | return }
var %now = $iif(%gmt,$gmt,$ctime)
var %delta = $calc(%now - %then)
var %until = $iif(%delta > 0,since,until)
var %durs = $remove($duration($abs(%delta)),ks,k,ays,ay,rs,r,ins,in,ecs,ec)
var %days = $round($calc($abs(%delta) / 86400),2)
echo -atic notice * Only $chr(31) $+ %durs $+ $chr(31) ( $+ %days days) $&
%until $chr(31) $+ $asctime(%then,ddd dd mmm yyyy HH:nn:ss) $+ $chr(32)
} ; by Raccoon 2019
since { until $1- }
sincegmt { until gmt $1- }
untilgmt { until gmt $1- }
I dare not attempt to clean up below this line, for the site will inexplicably crash.
Code
more code
code goes here
/echo -a test
Enjoy!
test
test
test
testy