C code to get local time offset in minutes relative to UTC?
问题 I didn't find a trivial way to get the time offset in minutes between the local time and the UTC time. At first I intended to use tzset() but it doesn't provide the daylight saving time. According to the man page, it is simply an integer different of zero if day light saving is in effect. While it is usually an hour, it may be half an hour in some country. I would prefer avoiding to compute the time difference between current UTC returned by gmtime() and localtime() . A more general solution