查找给定城市的UTC偏移量 [英] Find UTC Offset given a city
问题描述
在Windows上的C ++中,给定城市,可以说伦敦,纽约,悉尼或新加坡等.如何找到每个城市的UTC偏移量,即函数应该能够接受城市名称并返回城市名称当前情况下的UTC偏移量,即考虑到夏令时.关于如何使用Win32 API做到这一点的任何想法
In C++ on Windows, given a city, lets say london or newyork or sydney or singapore etc.. how do I find the UTC offset for each of them, ie the function should be able to accept a city name and return the UTC offset in the current scenario ie taking into account daylight savings. Any ideas how this can be done using win32 APIs
推荐答案
Sounds like you want an API for searching the zoneinfo / tz database..?
不知道是否存在一个具有所需接口的库.但是自己阅读和搜索并不困难.它只是一个平面文件数据库,每行只有一条记录.
Don't know if there is a library with precisely the interface you want. But reading it and searching it yourself would not be difficult. It's just a flat file database, text with one record per line.
http://en.wikipedia.org/wiki/Zone.tab
这篇关于查找给定城市的UTC偏移量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!