It's worth

reading about the Time library and also looking through the actual code (specifically the Time.h and Time.cpp files).

The Time library defines a couple new data types that you will want to be familiar with. It also defines a bunch of functions for working with these data types.

The

*time_t* data type represents a particular point in time, to a resolution of one second. Specifically, the value held in a

*time_t* variable is just the number of seconds since 00:00:00 01Jan1970 (the Unix epoch; the Arduino Time library has a lot in common with the standard C time library).

Actually

*time_t* is just an unsigned long integer.

To conveniently determine the month, day, year, hour, minute or second represented by a

*time_t* variable, there are a bunch of functions that are explained on the page linked above.

Not documented at the link above is another data type called

*tmElements_t*. This is actually a structure that has different members representing year, month, day, etc. Then there are two functions for converting between a

*time_t* variable and a

*tmElements_t* structure, makeTime() and breakTime().

Very useful library once you get the hang of it. Have a look, then if you don't get it, ask questions.