Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More explicit date-and-time resource #7

Open
Mossaka opened this issue Mar 27, 2023 · 2 comments · May be fixed by #23
Open

More explicit date-and-time resource #7

Mossaka opened this issue Mar 27, 2023 · 2 comments · May be fixed by #23

Comments

@Mossaka
Copy link
Collaborator

Mossaka commented Mar 27, 2023

Currently timestamp is defined as a u64 type, which doesn't really specify what kind of date and time representation it is. It might be seconds since Unix Epoch or it might noe be. I would suggest to come up with a more explictly date and time resource which provides methods to convert timestamp to different representations. Minimally, it should contain two methods

  1. unix_timestamp() -> i64 to get the Unix timestamp
  2. unix_timestamp_nanos() -> i128 to get the Unix timestamp in nanoseconds

In addition, we might want to consider adding from functions to convert unix timestamp this sturct as constructors.

We may want to define other functions such as date and time to return date and time representations resp.

CC @devigned

@ossfellow
Copy link

@Mossaka, this would, more or less, duplicate what wasi-clocks/wall-clock already does; so, reusing what's already provided might be a better approach than building anew.

@Mossaka
Copy link
Collaborator Author

Mossaka commented Jul 12, 2024

@Mossaka, this would, more or less, duplicate what wasi-clocks/wall-clock already does; so, reusing what's already provided might be a better approach than building anew.

Yeah that makes sense. Thank you for bringing this up!

thomastaylor312 added a commit to thomastaylor312/wasi-blobstore that referenced this issue Jul 29, 2024
This is a relatively simple PR that mostly restructures things. This
removes the container interface because there wasn't much you could do
with it by itself, it always had to be used in conjunction with the
blobstore interface. I also got rid of all of the type aliases for
strings to make the types interface cleaner, as well as follow what we've
been doing in the other wasi cloud interfaces with avoiding type aliases.

Additionally, I updated the timestamps to use the wasi-clock timestamps
instead so we were using a concrete type. That was the only major change
here, but it does solve an outstanding issue we have.

Closes WebAssembly#7

Signed-off-by: Taylor Thomas <[email protected]>
@thomastaylor312 thomastaylor312 linked a pull request Jul 29, 2024 that will close this issue
rvolosatovs pushed a commit to rvolosatovs/wasi-blob-store that referenced this issue Aug 16, 2024
This is a relatively simple PR that mostly restructures things. This
removes the container interface because there wasn't much you could do
with it by itself, it always had to be used in conjunction with the
blobstore interface. I also got rid of all of the type aliases for
strings to make the types interface cleaner, as well as follow what we've
been doing in the other wasi cloud interfaces with avoiding type aliases.

Additionally, I updated the timestamps to use the wasi-clock timestamps
instead so we were using a concrete type. That was the only major change
here, but it does solve an outstanding issue we have.

Closes WebAssembly#7

Signed-off-by: Taylor Thomas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants