Time zone conversion C API on Linux, anyone?

后端 未结 6 1247
终归单人心
终归单人心 2020-12-29 03:40

I\'m looking for something that I presumed would be very simple - given local Unix time in a specific time zone (specified as a string, e.g., \"America/New_York\" - note tha

6条回答
  •  甜味超标
    2020-12-29 04:07

    From tzfile(5), which documents the files in /usr/share/zoneinfo (on my system) in gruesome detail:

    It seems that timezone uses tzfile internally, but glibc refuses to expose it to userspace. This is most likely because the standardised functions are more useful and portable, and actually documented by glibc.

    Again, this is probably not what you're looking for (ie. an API), but the information is there and you can parse it without too much pain.

提交回复
热议问题