tests: detect and use portable time and date command

Advanced behavior of `time` and `date` is not protable. Thus try
to detect known working configurations and use them.

time and date are not fundamental for tests, so having
an unsupported implementation is not a big deal.