Funções GetSystemTime e GetLocalTime | Linguagem C

main.html
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>

void main(void) {
    system("title SYSTEMTIME");
    SYSTEMTIME st, lt;
    HANDLE pcmd;
    pcmd = GetStdHandle(STD_OUTPUT_HANDLE);
    GetSystemTime(&st);
    GetLocalTime(&lt);
    SetConsoleTextAttribute(pcmd, 46);
    printf(
        "\n\nHora do sistema: %02d:%02d\n",
        st.wHour,
        st.wMinute
    );
    printf(
        "Hora local: %02d:%02d\n",
        lt.wHour,
        lt.wMinute
    );
}

Comentários