I have a command that outputs a single date in whatever format I please. Now I need a simple way of calculating (with bash) how many hours have passed since that date (default is
The only way I can think of doing this is by using several
ifs, but I was hoping there might be a quick one-line method. Perhaps using the
Just an example for clarity:
Right now it is
The first command outputs
I need a command (or a few piped commands) that output
27, as in: "27 hours (rounded down) have passed since the specified date".
Is there a quick'n simple way to achieve that? Or am I bound to use conditionals (not that it'd be overly complex).