#include "stdafx.h"
#include <iostream>
#include <time.h>
#include <iomanip>
#include <ctime>
#include <chrono>
#include <iostream>
#include <time.h>
#include <iomanip>
#include <ctime>
#include <chrono>
void Zeit()
{
time_t Zeitstempel;
tm *nun;
Zeitstempel = time(0);
nun = localtime(&Zeitstempel);
int minute = nun->tm_min;
int second = nun->tm_sec;
if (minute < 10)
{
if (second < 10)
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << "0" << nun->tm_min << ':' << "0" << nun->tm_sec << endl;
}
else
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << "0" << nun->tm_min << ':' << nun->tm_sec << endl;
}
}
else
{
if (second < 10)
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << nun->tm_min << ':' << "0" << nun->tm_sec << endl;
}
else
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << nun->tm_min << ':' << nun->tm_sec << endl;
}
}
}
{
time_t Zeitstempel;
tm *nun;
Zeitstempel = time(0);
nun = localtime(&Zeitstempel);
int minute = nun->tm_min;
int second = nun->tm_sec;
if (minute < 10)
{
if (second < 10)
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << "0" << nun->tm_min << ':' << "0" << nun->tm_sec << endl;
}
else
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << "0" << nun->tm_min << ':' << nun->tm_sec << endl;
}
}
else
{
if (second < 10)
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << nun->tm_min << ':' << "0" << nun->tm_sec << endl;
}
else
{
cout << nun->tm_mday << '.' << nun->tm_mon + 1 << '.'
<< nun->tm_year + 1900 << "-" << nun->tm_hour
<< ':' << nun->tm_min << ':' << nun->tm_sec << endl;
}
}
}
Keine Kommentare:
Kommentar veröffentlichen