While the answer provided by Kevin Johnson perfectly explains how to handle binaries, I will post the explanation of what really happened.
The binary in Erlang (and hence in Elixir) might be created using ASCII values for chars:
iex|1 ▶ <<50, 48>>
#⇒ "20"
When you pattern matched to size(80) you actually pattern matched to 10 positions of the integer in 256-base. Basically, this is what happened:
iex|2 ▶ <<a1::size(8), a2::size(8), a3::size(8),
a4::size(8), a5::size(8), a6::size(8),
a7::size(8), a8::size(8), a9::size(8),
a10::size(8), _ :: binary>> = "2018-04-07 13..."
#⇒ "2018-04-07 13..."
Let’s check our values (yes, the array of integers is printed out as a bitstring whenever possible, note single quotes):
iex|3 ▶ [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]
#⇒ '2018-04-07'
OK, so far so good. Let’s now get the result out of the above integers. It would be:
a10 * 1 + a9 * 256 + a8 * 256² + ...
or, using the limited Elixir arithmetical abilities:
iex|4 ▶ [a1, a2, a3, a4, a5, a6, a7, a8, a9, a10]
...|4 ▷ |> Enum.reverse
...|4 ▷ |> Enum.with_index
...|4 ▷ |> Enum.reduce(0, fn {e, i}, acc ->
...|4 ▷ # ⇓⇓⇓ exact integer i-power of 256 ⇓⇓⇓
...|4 ▷ acc + e * Enum.reduce(List.duplicate(256, i), 1, &Kernel.*/2)
...|4 ▷ end)
#⇒ 237007314493411930484791
This is exactly what you yielded when have asked to pattern match first 10 positions to 256-based 10-digit number.