As part of the project, you need to get the Last-Modified time of files. There is a function called strftime that can help you do this.

Here is an example of getting the time in GMT:

#include <stdio.h>
#include <time.h>

int main(int argc, char *argv[])
{
        char buffer[1024];
        time_t t;
        struct tm *gmt;

        (void)argc; // silence unused warning
        (void)argv; // silence unused warning

        time(&t);
        gmt = gmtime(&t);

        strftime(buffer, 1024, "%x %X %Z", gmt);

        printf("%s\n", buffer);
}

The output of this is:

$ ./dtexample
01/28/17 21:35:37 GMT

Note: you’ll need the format to be:

Last-Modified: <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT

You can run “man strftime” to see the parameters needed to pick the right format.