C

How to get the UTC offset in C

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
 
int GetUTC(){
  time_t now = time(NULL);
  struct tm *lcl = localtime(&now);
  time_t local = mktime( lcl );
  struct tm *gmt = gmtime(&now);
  time_t utc = mktime( gmt );
  return (int)(difftime(local, utc) / 3600);
}
 
int main(void) {
	printf("UTC offset: %d\n", GetUTC());
	return EXIT_SUCCESS;
}