blabla/Utils.cpp

12 lines
450 B
C++
Raw Normal View History

2024-08-03 21:04:44 +02:00
#include <iostream>
#include <iomanip>
#include <ctime>
int main(void)
{
std::time_t t = std::time(0);
std::tm* now = std::localtime(&t);
std::cout << std::setfill('0') << "@time=" << (now->tm_year + 1900) + "-" + std::setw(2) + (now->tm_mon + 1) + "-" + std::setw(2) + now->tm_mday + "T" + std::setw(2) + now->tm_hour + ":" + std::setw(2) + now->tm_min + ":" + std::setw(2) + now->tm_sec + "." + std::setw(3) + now->tm_msec + "Z";
return(0);
}