Skip to content

WASI interface for accessing timezone offsets? #467

Open
@ColinEberhardt

Description

@ColinEberhardt

A little while back I started work on implementing the new TC39 Temporal standard in AssemblyScript. The non-timezone aware parts of this API were relatively easy to implement (see assemblyscript-temporal), however, the more interesting timezone-aware parts of the API are more challenging!

My initial attempt has been to store the IANA timezone database a part of the module, but this results in a sizeable binary, and decoding the IANA timezone files isn't much fun (see assemblyscript-temporal-tz).

Most environments where WebAssembly will be run will already have this timezone information available as part of the OS, so rather than include it within the wasm module, it makes sense access this information from the host, via WASI (calling it, for example, wasi-tz)

The WASI information that supports this would be very simple, the Temporal API can be implemented based on a single method offsetForTimezone(tz: string, epochMillis: i64): i32 . Although wasi-tz would probably need methods that allow you to enumerate supported timezones also.

What does this community think of this idea? Is there value in wasi-tz?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions