I'm trying to understand how to use the times module but I don't really get the docs on this. I get a timestamp from a db -> 1517875206
How can I compare this time with now() thanks.
you can compare against epochTime().int
or turn your value into a date fromUnix(1517875206).utc and compare against now().utc
import times
or accidentally import parseutils instead of strutils?
import std/[strutils, times]
let
ts = parseInt("1517875206")
d = fromUnix(ts).utc
now = now().utc
echo "ts = ", ts
echo "d = ", d
echo "now = ", now
if now < d:
echo "now = LESS"
else:
echo "now = EQUAL OR BIGGER"