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

std/time needs a get_local_time function #103

Closed
maximecb opened this issue Sep 12, 2017 · 1 comment
Closed

std/time needs a get_local_time function #103

maximecb opened this issue Sep 12, 2017 · 1 comment

Comments

@maximecb
Copy link
Member

The std/time library could use a function to get the local time. One potential use for this, besides knowing the time, is as a random seed for the random number generator.

The std/time library is implemented in vm/packages.cpp. I think we should just use the ctime functions to implement this.

The get_local_time function should return an object with fields based on the C tm struct. However, I would rename the fields to make them more intuitive, eg: year, month, day, week_day, year_day, is_dst. I also propose that we do not include tm_year (years since 1900) because that is retarded.

@maximecb
Copy link
Member Author

Aww yisss.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant