day can't be sed as a function

this works:

  Serial.print(year()); Serial.print(": ");

this fails:

time_t t = now(); int day = 0; Serial.print(day);  Serial.print(day(now));

with this error message:

/tmp/arduino_modified_sketch_903756/MEGA_W8BH_Clock_SolarTrak_jun_13_1030.ino: In function 'void setup()':
MEGA_W8BH_Clock_SolarTrak_jun_13_1030:334:71: error: 'day' cannot be used as a function
 time_t t = now(); int day = 0; Serial.print(day); Serial.print(day(now));
                                                                       ^
exit status 1
'day' cannot be used as a function

if fails with (day()); (day(now)); & (day(t));

this compiles, but does nothing: time_t t = now(); int day = 0; Serial.print(day); //Serial.print(day(t));

why does it work in one line but not another? how am I using it as a function?

What do you expect this to do given you just defined 'day' as an 'int'?

Serial.print(day(now));

Also, with 367 posts, you should know that just supplying code snippets is much less useful than a complete program.

/tmp/arduino_modified_sketch_903756/MEGA_W8BH_Clock_SolarTrak_jun_13_1030.ino: In function 'void setup()':
MEGA_W8BH_Clock_SolarTrak_jun_13_1030:334:71: error: 'day' cannot be used as a function
 time_t t = now(); int day = 0; Serial.print(day); Serial.print(day(now));
                                                                       ^
exit status 1
'day' cannot be used as a function

Makes sense you'd get this error.

Here int day = 0 day is defined as an integer variable.
Hereday(now) you are asking an integer variable to act like a function.

Also, with 367 posts, you should know that just supplying code snippets is much less useful than a complete program.

if you post an 18k code, you get "do you expect us to debug this Tolstoy novel..." No matter what you do on this board, someone tells you you're doing it wrong.

you are asking an integer variable to act like a function.

how? I am trying to copy a uint8_t to an int. that should be as simple as "int day=day(t);" I can Serial.print(day()); on one line of the program, but not on another. If I can't make it print, I can't see the result of the conversion, which also does not compile

You can't have two things with the same name. Give your integer a different name from the function.

that should be as simple as "int day=day(t);"

You are joking, of course.

That's where the concept of creating / posting an MCVE comes it. That's the minimal possible (but complete) code that compiles and shows the exact same problem as your big code, and nothing else. In the case of a compilation error (such as yours), it shows the exact same compilation error, and nothing else. Leave out everything else from your original code as it’s just unrelated clutter.

In fact, many times simply creating the MCVE helps you find the error.

"int day=day(t);", you are joking, right?

Have a look here: C++ Functions on how to do the function thing.

int day = 0 and then day(whatever) is asking the variable day to do the work of a function.

Very basic, by typing int day = 0; the keyword day has been redefined.

TRY THIS INSTEAD int iDay = 0;

Oi! Also, you should review C++ Variables