In C, gmtime_s converts a time_t value into broken-down time expressed as UTC, while localtime_s expresses the same value in the local time zone. UTC is the universal reference time used for civil timekeeping. section 8.5
Choosing the conversion
struct tm result; gmtime_s(&instant, &result); /* UTC */ localtime_s(&instant, &result); /* local time */ The two functions differ in the time zone assumed during conversion. localtime_s and mktime should normally be inverse operations; gmtime_s has no direct inverse counterpart. section 8.5
After conversion, strftime can format the struct tm using date and time specifiers. Locale settings, including preferred language or time zone, may influence selected output. section 8.5



