More languages should copy Go&#x27;s time library.<p>As someone who has written a lot of Go for years, I am always very quick to say that &quot;time&quot; is my favorite Go standard library. I love it.<p>The &quot;time&quot; library is to Go what the &quot;requests&quot; [non-standard] library is to Python, in terms of a great API and simplicity. For some reason in every other language I&#x27;ve used (important, I don&#x27;t know every time library! :P) the time library has always been adequate, but not much else.<p>I think Python&#x27;s &quot;datetime&quot; is a great example of a not great time library. At one point I was writing Python every day for a couple years. During that time, I could never ever remember the API for datetime, despite it being able to do what I needed to do well enough. I always had to open the docs. I think this is an example of an adequate library that just doesn&#x27;t have a great API.<p>Or, take the more generic problem of: I have a time, I have a duration, how do I tell if that duration has passed? Most developers I know (including myself) stumble on this for some period of time (see what I did there?), remembering what do I add to what and is it a greater than or a less than or do I subtract, etc. It is an easy problem, but always seems to require a little bit of thinking.<p>Go&#x27;s &quot;time&quot; library is nothing like this.<p>Go&#x27;s &quot;time&quot; library you will remember the API, it is intuitive. You can even guess it after writing Go for some period of time. It is that easy (ignoring the constants and non-standard printf-like function in it).<p>Go&#x27;s &quot;time&quot; comparison&#x2F;arithmetic is incredible. Comparing times? Determining expiration? You&#x27;ll almost never get this wrong the first time. (But write tests anyways)<p>What I&#x27;m trying to say is: even if you don&#x27;t like Go, take a look at how Go&#x27;s &quot;time&quot; library works. I think it would be valuable for other languages. Other languages can probably even do it better (imagining better type systems around units), but I&#x27;ve never seen an API that feels as right for manipulating time as Go&#x27;s time stdlib.