Nimit Bhargava wrote: . . .
Although that code accurately reflects its structure,
you should add {} and it is usual to indent
else‑ifs differently, so it comes out as:-
Whenever you use a block of
else‑ifs, make sure they run in order.
More style things: don't expect people to know what 60 or 86400 mean: use constants: SECONDS_IN_DAY or SECONDS_IN_MINUTES. And never use the
tab key.