[This answer is for the Linux kernel since linux-kernel was tagged in the question.]
mktime64
is nothing to do with jiffies. It converts the date specified by its parameters to the number of seconds (ignoring leap seconds) since 1970-01-01 00:00:00 (Unix time since the epoch if the parameters are for GMT).
The returned time64_t
value can be converted back to year, month, day, hours, minutes, seconds using the time64_to_tm
function in the kernel. It has this prototype:
void time64_to_tm(time64_t totalsecs, int offset, struct tm *result);
The offset
parameter is a local timezone offset in seconds (number of seconds east of GMT). It should be set to 0 to undo the conversion done by mktime64
.
Note that the tm_year
member is set to the calculated year minus 1900 and the tm_mon
member is set to the calculated month minus 1, so you could implement an unmktime64
function as follows:
void unmktime64(time64_t totalsecs,
int *year, unsigned int *month, unsigned int *day,
unsigned int *hour, unsigned int *minute, unsigned int *second)
{
struct tm tm;
time64_to_tm(totalsecs, 0, &tm);
*year = tm.tm_year + 1900;
*month = tm.tm_mon + 1;
*day = tm.tm_mday;
*hour = tm.tm_hour;
*minute = tm.tm_min;
*second = tm.tm_sec;
}