Im working with dates on ecto, specifically the naive_datetime struct, dealing with some errors i found this strange behavior,
~N[2018-08-09 17:34:49] < ~N[2018-08-09 17:34:50] => true ~N[2018-08-09 17:34:49.000000] < ~N[2018-08-09 17:34:50] => false
My “improvised” solution was something like this
now = NaiveDateTime.utc_now() |> NaiveDateTime.truncate(:second)
Is it really an error? or, is it supposed to work that way?
p.s: I know there is a function NaiveDateTime.compare/2, but i cannot use that function into an ecto.query