error accessing struct tm data from avr.libc time

We need to see you full code...
For example - If you don't initialize myYear anywhere then it should be no surprise that values are zero for a global variable.