strftime will take a struct tm and a format string (like printf sort of), which you can get by calling localtime or gmtime.

Or you could just use sprintf() with the data in struct tm, since it...