은 (일광 절약 시간에 현재 사람들을 잡으려고).
이 free, open source C++11/14 library 사용하여, 나는이 프로그램을 썼다 : 모두 지금이 현재 "GMT"를 사용하는 모든 시간대의 행성을 검색
#include "tz.h"
#include <string>
#include <iostream>
#include <vector>
template <class Duration>
std::vector<date::zoned_time<std::common_type_t<Duration, std::chrono::seconds>>>
find_by_abbrev(date::sys_time<Duration> tp, const std::string& abbrev)
{
using namespace std::chrono;
using namespace date;
std::vector<zoned_time<std::common_type_t<Duration, seconds>>> results;
auto& db = get_tzdb();
for (auto& z : db.zones)
{
if (z.get_info(tp).abbrev == abbrev)
results.push_back(make_zoned(&z, tp));
}
return results;
}
int
main()
{
using namespace std::chrono;
using namespace date;
auto now = system_clock::now();
auto v = find_by_abbrev(now, "GMT");
for (auto const& x : v)
std::cout << format("%F %H:%M:%S %Z %z", x) << " "
<< x.get_time_zone()->name() << '\n';
std::cout << '\n';
v = find_by_abbrev(now + months{6}, "GMT");
for (auto const& x : v)
std::cout << format("%F %H:%M:%S %Z %z", x) << " "
<< x.get_time_zone()->name() << '\n';
}
, 그리고 지금부터 6 개월, 그들을 밖으로 인쇄 :
2016-06-18 01:00:25.632773 GMT +0000 Africa/Abidjan
2016-06-18 01:00:25.632773 GMT +0000 Africa/Accra
2016-06-18 01:00:25.632773 GMT +0000 Africa/Bissau
2016-06-18 01:00:25.632773 GMT +0000 Africa/Monrovia
2016-06-18 01:00:25.632773 GMT +0000 America/Danmarkshavn
2016-06-18 01:00:25.632773 GMT +0000 Atlantic/Reykjavik
2016-06-18 01:00:25.632773 GMT +0000 Etc/GMT
2016-12-17 15:55:01.632773 GMT +0000 Africa/Abidjan
2016-12-17 15:55:01.632773 GMT +0000 Africa/Accra
2016-12-17 15:55:01.632773 GMT +0000 Africa/Bissau
2016-12-17 15:55:01.632773 GMT +0000 Africa/Monrovia
2016-12-17 15:55:01.632773 GMT +0000 America/Danmarkshavn
2016-12-17 15:55:01.632773 GMT +0000 Atlantic/Reykjavik
2016-12-17 15:55:01.632773 GMT +0000 Etc/GMT
2016-12-17 15:55:01.632773 GMT +0000 Europe/Dublin
2016-12-17 15:55:01.632773 GMT +0000 Europe/London
나는 모든 경우에 UTC 오프셋이 +0000
임을 알았습니다. 정치인과 시간대를 알지 못합니다. 일부 입법 기관은 "그린 마운틴 타임"을 쉽게 선언 할 수 있습니다 (내일은 가능할 수도 있음).
나는 GMT와 UTC가 같다고 생각한다. 차이점은이를 정의하는 조직의 이름입니다. 영국 (GMT = 그리니치 자오선 시간)은 국제 시간 (UTC)보다 먼저 나타났습니다. http://en.wikipedia.org/wiki/UTC –
을 참조하십시오. UTC는 프랑스어이고 GMT는 영어이기 때문에? – arx
[표준 시간대 약어 목록] (http://en.wikipedia.org/wiki/List_of_time_zone_abbreviations), [UTC 오프셋 표준 시간대 목록] (http : // en) .wikipedia.org/wiki/List_of_time_zones_by_UTC_offset # toc) –