| // 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`, get the timezone name from |
| // `fuchsia.intl.PropertyProvider`, and use the ICU library to compute the |
| // offset. |
| // - For `SetTimezone`, 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. |
| @deprecated("use the ICU library to compute the time zone offset") |
| GetTimezoneOffsetMinutes(struct { |
| milliseconds_since_epoch int64; |
| }) -> (struct { |
| local_offset_minutes int32; |
| dst_offset_minutes int32; |
| }); |
| |
| /// Sets the timezone for the machine based on an ICU ID. |
| /// |
| /// Do not introduce new uses: SetTimezone today exists only so it can |
| /// support the one remaining use of `GetTimezoneOffsetMinutes`. Use |
| @deprecated("use fuchsia.settings.Intl instead") |
| SetTimezone(struct { |
| timezone_id string; |
| }) -> (struct { |
| status bool; |
| }); |
| }; |