error accessing struct tm data from avr.libc time

Arduino clock is not so perfect. RTC is Real Time Clock, one way people use for being sure of the time.
Your way is good too but I think cost more over time.

A C tutorial on pointers, enough for a good start.

I could type a lot and not say any more. Pointers are C power tools.