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.
There's some extremely common time-related tasks it'd be really nice to demonstrate.
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.