C30 Mktime() further than 2021 timestamp returns error -1.
I having problems with C30 compiler mktime() function.
If put 2020(120)/dec/31 23:59:59 GMT+1 in compiler's mktime() it returns epoch_seconds=1609459199
that is OK I have verified it in www.epochconverter.com
But, if I put 2021/jan/01 00:00:00 GMT+1 (on second later) it returns 4294967295 that is wrong result.
Could somebody give some help about this? I need more than 2020 working timestamp.
Because mktime is a precompiled function, I can't see what is happening inside function.
Could somebody send me mktime() source in C30?
Is this a known behaviour or library bug?
Thank you and best regards.
Aditional info about usage of mktime function is found in page 146 of 16-Bit_Language_Tools_Libraries_51456E.pdf
Converts local time to a calendar value.
Prototype: time_t mktime(struct tm *tptr);
Argument: tptr a pointer to the time structure
Return Value: Returns the calendar time encoded as a value of time_t.
Remarks: If the calendar time cannot be represented, the function returns -1, castas a time_t (i.e. (time_t) -1).
post edited by japeral - 2012/05/17 09:28:31