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 050f9e2 commit 2a0fb0cCopy full SHA for 2a0fb0c
lib/elixir/test/elixir/calendar/time_test.exs
@@ -38,6 +38,18 @@ defmodule TimeTest do
38
end
39
40
41
+ test "to_iso8601/2" do
42
+ time1 = ~T[23:00:07.005]
43
+ assert Time.to_iso8601(time1) == "23:00:07.005"
44
+ assert Time.to_iso8601(Map.from_struct(time1)) == "23:00:07.005"
45
+ assert Time.to_iso8601(time1, :basic) == "230007.005"
46
+
47
+ time2 = ~T[23:00:07.005 Calendar.Holocene]
48
+ assert Time.to_iso8601(time2) == "23:00:07.005"
49
+ assert Time.to_iso8601(Map.from_struct(time2)) == "23:00:07.005"
50
+ assert Time.to_iso8601(time2, :basic) == "230007.005"
51
+ end
52
53
test "to_string/1" do
54
time = ~T[23:00:07.005]
55
assert to_string(time) == "23:00:07.005"
0 commit comments