Luckily the 24 hour clock comes with a rollover counter, which may be confusingly named something like “day.” Consult accompanying documentation for details.
If your hardware vendor did not include a “day” counter, you may need to implement in wetware.
But then that rolls over every seven "days" incrementing the "week" counter, and then either 28, 29, 30, or 31 days in a bizarre pattern incrementing the "month" counter. Then - get this - every 365.25 days it increments the "year" counter, which is just so spectacularly half-assed. Three hundred and sixy-five *and a quarter* days. WTAF.
You could store the number of milliseconds since an arbitrary date in Greenwich UK, and provide methods to get the time, but even this has problems.
The units could be defined by atomic vibrations or by the spinning of a large celestial object but these don’t agree. What is more the large celestial object (and others nearby) distorts space and time adding to the issue of where the time is (see my past submission on Barycentric Time)
If your hardware vendor did not include a “day” counter, you may need to implement in wetware.