//
// NTTEST.C
// This program demonstrates calling routines in the Win32 API
//
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>



main()
{
    short year;
    char month, day, hours, minutes, seconds, hunds;

    SYSTEMTIME sys_time;

    printf("Getting System Date and Time with INT 21H\n");

    _asm
    {
        mov     ah,2ah
        int     21h
        mov     year,cx
        mov     month,dh
        mov     day,dl

        mov     ah,2ch
        int     21h
        mov     hours,ch
        mov     minutes,cl
        mov     seconds,dh
        mov     hunds,dl
    }

    printf("It is now %d:%d:%d.%d on %d/%d/%d\n",
            hours, minutes, seconds, hunds, month, day, year);


    // System Time for Windows NT is Greenwich Mean Time
    // what we want is local time

    printf("Getting Local Date and Time with Win32\n");

    GetLocalTime(&sys_time);
    printf("It is now %d:%d:%d.%d on %d/%d/%d\n",
            sys_time.wHour, sys_time.wMinute, sys_time.wSecond,
            sys_time.wMilliseconds, sys_time.wMonth, sys_time.wDay, 
            sys_time.wYear);

    exit(0);
}
