I’m developing a program where we would store settings for dates in the future, as well as have an operating life of 25 years. However when using the standard time functions from the le_clk api I’m running into the issue that dates past 2038 seem to give errors.
Is there a solution for this or am I going to have to roll my own time code?
example:
char timeString[128]; char* date; le_clk_Time_t currentTime = {0}; date = "2049-12-06 08:23:00"; le_result_t res = le_clk_ConvertToTime("%Y-%m-%d %H:%M:%S", date, ¤tTime); le_clk_ConvertToLocalTimeString(currentTime, "%Y-%m-%d %H:%M:%S", timeString, sizeof(timeString), &readSize); LE_INFO("%s => %s, %ld, %d", date, timeString, currentTime.sec, res);
This results in:
2049-12-06 08:23:00 => 1969-12-31 23:59:59, -1, -6