Skip to content

Instantly share code, notes, and snippets.

@jc00ke
Created December 20, 2016 18:45
Show Gist options
  • Save jc00ke/5d84507734155869162c27857945deef to your computer and use it in GitHub Desktop.
Save jc00ke/5d84507734155869162c27857945deef to your computer and use it in GitHub Desktop.
⟩ iex
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Interactive Elixir (1.4.0-rc.1) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> dt = DateTime.
compare/2 from_iso8601/1 from_naive!/2 from_naive/2
from_unix!/1 from_unix!/2 from_unix/1 from_unix/2
to_date/1 to_iso8601/1 to_naive/1 to_string/1
to_time/1 to_unix/1 to_unix/2 utc_now/0
iex(1)> dt = DateTime.utc_now
%DateTime{calendar: Calendar.ISO, day: 20, hour: 18, microsecond: {323092, 6},
minute: 41, month: 12, second: 53, std_offset: 0, time_zone: "Etc/UTC",
utc_offset: 0, year: 2016, zone_abbr: "UTC"}
vvvvvvvvvvvvvvvv tab tab
iex(2)> dt.str*** ERROR: Shell process terminated! (^G to start new job) ***
10:41:58.499 [error] Process #PID<0.51.0> raised an exception
** (Protocol.UndefinedError) protocol Enumerable not implemented for %DateTime{calendar: Calendar.ISO, day: 20, hour: 18, microsecond: {323092, 6}, minute: 41, month: 12, second: 53, std_offset: 0, time_zone: "Etc/UTC", utc_offset: 0, year: 2016, zone_abbr: "UTC"}
(elixir) lib/enum.ex:1: Enumerable.impl_for!/1
(elixir) lib/enum.ex:116: Enumerable.reduce/3
(elixir) lib/enum.ex:1767: Enum.reduce/3
(iex) lib/iex/autocomplete.ex:290: IEx.Autocomplete.match_map_fields/2
(iex) lib/iex/autocomplete.ex:137: IEx.Autocomplete.expand_map_field_access/2
(kernel) group.erl:568: :group.get_line1/4
(kernel) group.erl:462: :group.get_chars_loop/8
(kernel) group.erl:181: :group.io_request/5
User switch command
-->
-->
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
(v)ersion (k)ill (D)b-tables (d)istribution
^C⏎
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment