blob: 29d86bba1052c7170c97e736e124cf9341de5c70 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.deprecatedtimezone;
// NOTE: this FIDL protocol is deprecated and slated for removal. Please do
// not add new uses that depend on it. Use instead the following functionality:
//
// - For `GetTimezoneOffsetMinutes` and `GetTimezoneId`, get the timezone name
// from `fuchsia.intl.ProfileProvider`, and use the ICU library to compute
// the offset.
// - For `SetTimezone` and `Watch`, please use `fuchsia.settings.Intl`.
//
// For more information on the ICU timezone ID format, see:
// http://userguide.icu-project.org/datetime
[Discoverable]
protocol Timezone {
/// Returns local timezone offset (in minutes from UTC. Can be negative) for
/// the supplied number of milliseconds since the Unix epoch. Returns a
/// non-zero DST offset when appropriate.
GetTimezoneOffsetMinutes(int64 milliseconds_since_epoch)
-> (int32 local_offset_minutes, int32 dst_offset_minutes);
/// Sets the timezone for the machine based on an ICU ID.
SetTimezone(string timezone_id) -> (bool status);
/// Gets the timezone ID string.
GetTimezoneId() -> (string timezone_id);
/// Watches for updates to the timezone ID.
Watch(TimezoneWatcher watcher);
};
protocol TimezoneWatcher {
/// When the timezone changes, returns the new timezone ID.
OnTimezoneOffsetChange(string timezone_id);
};