Problems with my unix-epoch time converter
问题 I wrote a simple function to fill three variables with the current year, month, and day. However, for some reason it is not working correctly, and I can't seem to find the problem. void getDate(int *year, int *month, int *date) { int epochTime, monthLength, functionYear, functionMonth, functionDate; functionYear = 1970; functionMonth = 1; functionDate = 1; epochTime = time(NULL); while (epochTime > 1 * 365 * 24 * 60 * 60) { epochTime -= 1 * 365 * 24 * 60 * 60; functionYear++; } monthLength =