#include #include #include #include typedef __u64 u64; #define NTFS_TIME_OFFSET ((u64)(369*365 + 89) * 24 * 3600 * 10000000) static time_t smb_ntutc2unixutc(u64 ntutc) { u64 t = ntutc - NTFS_TIME_OFFSET; printf("adjusted: %Lx\n", t); do_div(t, 10000000); printf("/ 10000000: %Lx\n", t); return (time_t)t; } int main() { time_t t; t = time(NULL); printf("now: %ld\n", t); t = smb_ntutc2unixutc(0x01c29fb515986100LL); printf("%ld\n", t); }