elixir-sqlite/sqlitex

How should we represent date/time values?

mmmries opened this issue · 1 comments

This line from my test is giving me heartburn:

assert row == [id: 1, name: "Mikey", created_at: "2012-10-14 05:46:28.318107", updated_at: "2013-09-06 22:29:36.610911", type: :undefined]

Is there a standard way to represent these values in Elixir/Erlang?

I'm pretty sure that passing around times as strings is a bad idea since it would be impossible to do math or formatting without turning into some sort of numeric representation.

I've got with the {{2012,10,14},{05,46,28}} format for now. It loses the fractional second values, but it is a lot easier for humans to read than Erlang's {megasecond,microsecond} form.