#include <windows.h>
#include <iostream>
char *timeStamp();
int main(void) {
printf_s("%s", timeStamp());
return 0;
}
char *timeStamp() {
SYSTEMTIME t;
GetLocalTime(&t);
char buffer[35];
int j;
j = sprintf_s(buffer, 25, "%02d/", t.wDay);
j += sprintf_s(buffer + j, 30 - j, "%02d/", t.wMonth);
j += sprintf_s(buffer + j, 30 - j, "%04d ", t.wYear);
j += sprintf_s(buffer + j, 30 - j, "%02d:", t.wHour);
j += sprintf_s(buffer + j, 30 - j, "%02d:", t.wMinute);
j += sprintf_s(buffer + j, 30 - j, "%02d = ", t.wSecond);
printf_s("%s\n", buffer);
return buffer;
}