error accessing struct tm data from avr.libc time

MHz:
Hi GoForSmoke,
thank you for fast reply. However I'm still missing something. Pls have a look at my modified code

#include <time.h> // die lib einbinden

tm myYear;

void setup() {

...

Serial.println(myYear.tm_year);

No compiler errors anymore - great! However the printed result is 0 and not as expected.

Thank you for helping a newbee!

A struct is a kind of variable. First you define it and then you initialize and THEN you can use it.

Is there a function in time.h to help you fill your tm structure named myYear?