wolfcw / libfaketime

libfaketime modifies the system time for a single application
https://github.com/wolfcw/libfaketime
GNU General Public License v2.0
2.71k stars 325 forks source link

Can I combine relative timespans? #410

Open buhtz opened 2 years ago

buhtz commented 2 years ago

It seems to me that I can not do something like this.

faketime "-2d +3h" date

This means 2 days into the past but 3h into the future. Or you could say 45 hours into the past (2x24 - 3).

wolfcw commented 2 years ago

You're right that this does not work. It expects a (single) value, not an arbitrary expression.

It's a time machine, not a calculator. :-)

However, there should be CLI-based date/time calculating tools around to combine with.

buhtz commented 2 years ago

I see. But an error should be thrown when something like this is given.