Problem Statement: How to calculate TTL (Time To Live) for objects in cache?
Step 1: Get the data in cron expression.
From the cron expression http://www.cronmaker.com/
Step 2: Evaluate the expression and get next execution time.
Step 3: Take the diff between nex time and present time.
i.e TTL = next execution time – current time;
What is Cron Expression: