Can anybody suggest how can we create a program in C to know the last modification date of any file?
Function is gmtime and covert into string. Try something like this -
char *get_last_modified(char *file) { struct tm *clock; struct stat attr; stat(file, &attr); clock = gmtime(&(attr.st_mtime)); return asctime(clock); }
input: one two three
output: three two one