timezone.h 844 B

123456789101112131415161718192021222324
  1. // Copyright 2013 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef BASE_I18N_TIMEZONE_H_
  5. #define BASE_I18N_TIMEZONE_H_
  6. #include <string>
  7. #include "base/i18n/base_i18n_export.h"
  8. namespace base {
  9. // Checks the system timezone and turns it into a two-character ISO 3166 country
  10. // code. This may fail (for example, it used to always fail on Android), in
  11. // which case it will return an empty string. It'll also return an empty string
  12. // when the timezone is Etc/UTC or Etc/UCT, but will return 'GB" for Etc/GMT
  13. // because people in the UK tends to select Etc/GMT by mistake instead of
  14. // Europe/London (British Time).
  15. BASE_I18N_EXPORT std::string CountryCodeForCurrentTimezone();
  16. } // namespace base
  17. #endif // BASE_I18N_TIMEZONE_H_