File: timezone.wit

package info (click to toggle)
rust-wasmtime 26.0.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 48,492 kB
  • sloc: ansic: 4,003; sh: 561; javascript: 542; cpp: 254; asm: 175; ml: 96; makefile: 55
file content (55 lines) | stat: -rw-r--r-- 2,219 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package wasi:clocks@0.2.1;

@unstable(feature = clocks-timezone)
interface timezone {
    @unstable(feature = clocks-timezone)
    use wall-clock.{datetime};

    /// Return information needed to display the given `datetime`. This includes
    /// the UTC offset, the time zone name, and a flag indicating whether
    /// daylight saving time is active.
    ///
    /// If the timezone cannot be determined for the given `datetime`, return a
    /// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
    /// saving time.
    @unstable(feature = clocks-timezone)
    display: func(when: datetime) -> timezone-display;

    /// The same as `display`, but only return the UTC offset.
    @unstable(feature = clocks-timezone)
    utc-offset: func(when: datetime) -> s32;

    /// Information useful for displaying the timezone of a specific `datetime`.
    ///
    /// This information may vary within a single `timezone` to reflect daylight
    /// saving time adjustments.
    @unstable(feature = clocks-timezone)
    record timezone-display {
        /// The number of seconds difference between UTC time and the local
        /// time of the timezone.
        ///
        /// The returned value will always be less than 86400 which is the
        /// number of seconds in a day (24*60*60).
        ///
        /// In implementations that do not expose an actual time zone, this
        /// should return 0.
        utc-offset: s32,

        /// The abbreviated name of the timezone to display to a user. The name
        /// `UTC` indicates Coordinated Universal Time. Otherwise, this should
        /// reference local standards for the name of the time zone.
        ///
        /// In implementations that do not expose an actual time zone, this
        /// should be the string `UTC`.
        ///
        /// In time zones that do not have an applicable name, a formatted
        /// representation of the UTC offset may be returned, such as `-04:00`.
        name: string,

        /// Whether daylight saving time is active.
        ///
        /// In implementations that do not expose an actual time zone, this
        /// should return false.
        in-daylight-saving-time: bool,
    }
}