Hello everyone,
using ksh I need to figure out how many days have passed between a timestamp and the current date of today.
Format of the timestamp is:
YYYYMMDD (e.G. 20200703)
Using
will give me the correct format for the current date and at first sight simply substracting both is working fine as long as both are within the same month ...
e.G.
Problem is obvious:
Any ideas how to solve this ?
Best Regards,
Thomas
using ksh I need to figure out how many days have passed between a timestamp and the current date of today.
Format of the timestamp is:
YYYYMMDD (e.G. 20200703)
Using
Code:
date +%Y%m%d
will give me the correct format for the current date and at first sight simply substracting both is working fine as long as both are within the same month ...
e.G.
Code:
20200716 - 20200703
Problem is obvious:
Code:
20200801 - 20200703
Any ideas how to solve this ?
Best Regards,
Thomas