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

Time #5

Open
chris-martin opened this issue Sep 30, 2019 · 0 comments
Open

Time #5

chris-martin opened this issue Sep 30, 2019 · 0 comments
Labels
good for new contributors Pull requests welcome! new example This issue is about writing a new example program.

Comments

@chris-martin
Copy link
Member

There's some extremely common time-related tasks it'd be really nice to demonstrate.

  • Rendering and parsing yyyy-mm-dd format
  • Getting the current unix timestamp as an integer in the units of your choice (e.g. seconds or milliseconds)
  • Converting a unix timestamp to an appropriate time type (e.g. if we're consuming a JSON API that expresses a time as a timestamp)
  • Basic time arithmetic, like getting a time that represents "a year from now"

If using the time package, make sure you're using the latest version, because the API has changed a bit recently. time has gotten a bit better with the new changes but I wouldn't mind recommending a different library if anybody can recommend something friendlier.

Potential idea for a practial example: use the cookies library to generate a set-cookie header for a cookie that is set to expire one month in the future.

@chris-martin chris-martin added good for new contributors Pull requests welcome! new example This issue is about writing a new example program. labels Sep 30, 2019
@tfausak tfausak mentioned this issue Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good for new contributors Pull requests welcome! new example This issue is about writing a new example program.
Projects
None yet
Development

No branches or pull requests

1 participant