Is there any possible way to display the date and time that my program was executed?
Printable View
Is there any possible way to display the date and time that my program was executed?
Code:#include <stdio.h>
#include <time.h>
int main(void)
{
time_t now = time(NULL);
puts(asctime(localtime(&now)));
/* [edit]
puts(ctime(&now));
[/edit] */
return 0;
}
if you want to save it for later you can always trow it down in a file aswell.