The following program demonstrates the asctime library function, which converts a struct tm to a string. For asctime, it is irrelevant whether the struct tm corresponds to UTC time or local time.
The program below uses asctime to print the current timestamp for both the UTC time and local time.