how can we get the end date of execution of the file. Actually,I have created a file who write in a file.
I would like to write in this file, the end date of execution, that's is possible ?
My file :
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void writeOn(fstream& file) {
if(file)
{
string name = "Peter";
string nickname = "Shanks";
file << "Hi, " << name << endl;
file << __DATE__ << ":" << __TIME__ << endl;
}
else
cerr << "Unable to open file" << endl;
int main() {
fstream file("trace.log", ios::out | ios::trunc);
writeOn(file);
return 0;
}