diff --git a/headers/os/locale/LocaleRoster.h b/headers/os/locale/LocaleRoster.h index 14089b8ac4..b4b2d379a7 100644 --- a/headers/os/locale/LocaleRoster.h +++ b/headers/os/locale/LocaleRoster.h @@ -42,6 +42,7 @@ class BLocaleRoster { status_t GetDefaultTimeZone(BTimeZone**timezone) const; void SetDefaultCountry(BCountry *) const; + void SetDefaultTimeZone(const char* zone) const; void UpdateSettings(BMessage* newSettings); status_t GetLanguage(const char* languageCode, BLanguage** _language) diff --git a/src/kits/locale/LocaleRoster.cpp b/src/kits/locale/LocaleRoster.cpp index 4ebe416c02..41c992f671 100644 --- a/src/kits/locale/LocaleRoster.cpp +++ b/src/kits/locale/LocaleRoster.cpp @@ -37,6 +37,7 @@ // ICU includes #include +#include /* @@ -544,6 +545,13 @@ BLocaleRoster::SetDefaultCountry(BCountry* newDefault) const } +void +BLocaleRoster::SetDefaultTimeZone(const char* zone) const +{ + TimeZone::adoptDefault(TimeZone::createTimeZone(zone)); +} + + void BLocaleRoster::UpdateSettings(BMessage* newSettings) { diff --git a/src/preferences/time/ZoneView.cpp b/src/preferences/time/ZoneView.cpp index a13aed96a7..2d5a085ca6 100644 --- a/src/preferences/time/ZoneView.cpp +++ b/src/preferences/time/ZoneView.cpp @@ -374,5 +374,7 @@ TimeZoneView::SetTimeZone(const char *zone) { putenv(BString("TZ=").Append(zone).String()); tzset(); + + be_locale_roster->SetDefaultTimeZone(zone); }