How to get the current (date)time and add one hour to it?

You could also use std.Io.Clock.real.now(io), to get a Timestamp, no need to dive into the vtable.

This fits in well with the another post today Simple timestamp lib to record timestamp in logs with millisecond precision (and another linked post in it Format timestamp into ISO 8601 strings).

i strongly disagree, but then again, i would, being a co-maintainer of the Lua bindings for Zig, wouldn’t I. Like many if not most projects, Ziglua follows master but we tend to rely on PRs and issues to make sure we’re paying attention to when master breaks us.

Nothing against libraries, but I wish there are more applications with concrete use cases and are as visible as their corresponding libraries.
I would look at those applications and see how I can incorporate them to my use case. After I get my project working it may suck, but I can work towards giving it the functionality of a library or an application which has all the bells and whistles, i.e., there’s scope for craft.

Dependencies have a way of creeping in - in the beginning its going to be just one library, after a while another, and so on. If I take this approach, I will have essentially thrown in the towel at some stage, and be left duct taping dependencies to have a project working. This reflects poorly on me because I didn’t end up doing much and what I did doesn’t look good.

It’s fun to own your whole codebase, to be sure, but it’s also fun to write useful code rather than reinvent the wheel.

I’m not using datetime yet so I’ll give a different example - CLI. All popular libraries existed before I began working on my projects. I’m using the below features of the standard library:

ArgIterator and while loop to go through command line arguments, StaticStringMap and enum to “register” actions, and a struct containing switch, if, and else to parse and validate them.
I could have used a library, but glad I didn’t because I really enjoyed taking this approach. Even if its not as good as using a library, I’d use the standard library ten times out of ten.

No reinvention here and I also dont think approaching datetime using the above linked posts is reinvention.

Your argument against libraries also surely extends to std verbatim.

100%. My projects will never have a dependency other than the standard library. They may end up being verbose but thats fine. I hope std remains juicy like main :slight_smile: