v2: use time package primitives where possible.