static int TmFromSystemTime()

in src/win32/dt_win32.c [449:467]


static int TmFromSystemTime(const SYSTEMTIME *pTime, struct tm *tm)
{
    if (tm == NULL || pTime == NULL) {
        return EXIT_FAILURE;
    }

    memset(tm, 0, sizeof(tm));

    tm->tm_year = pTime->wYear - 1900;
    tm->tm_mon = pTime->wMonth - 1;
    tm->tm_mday = pTime->wDay;
    tm->tm_wday = pTime->wDayOfWeek;

    tm->tm_hour = pTime->wHour;
    tm->tm_min = pTime->wMinute;
    tm->tm_sec = pTime->wSecond;

    return EXIT_SUCCESS;
}