We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64cd202 commit ae8262aCopy full SHA for ae8262a
lib/elixir/lib/calendar/time.ex
@@ -331,12 +331,16 @@ defmodule Time do
331
332
iex> Time.compare(~T[16:04:16], ~T[16:04:28])
333
:lt
334
+ iex> Time.compare(~T[16:04:16], ~T[16:04:16])
335
+ :eq
336
iex> Time.compare(~T[16:04:16.01], ~T[16:04:16.001])
337
:gt
338
339
This function can also be used to compare across more
340
complex calendar types by considering only the time fields:
341
342
+ iex> Time.compare(~N[1900-01-01 16:04:16], ~N[2015-01-01 16:04:16])
343
344
iex> Time.compare(~N[2015-01-01 16:04:16], ~N[2015-01-01 16:04:28])
345
346
iex> Time.compare(~N[2015-01-01 16:04:16.01], ~N[2000-01-01 16:04:16.001])
0 commit comments