Read a date in xkcd notation
CJam, 35 bytes

ll{1$e&gt;}*](l+eeWf%$-8&gt;Wf=\f=2/(o'-*


Try it here. It expects the input lines to be padded with spaces.

Explanation

ll reads two lines of input, and {1$e&gt;}* performs a "scan" on the second one: it it takes all prefixes of its input and computes the maximum of each prefix. For the input line "0  1  2  7  8", this pushes "0001112227778". Our stack now looks like this:

"first line" '0 '0 '0 '1 '1 '1 ...


We need to re-capture the values into a list ourselves using ]; this captures our first line as well, so we pop it back out using (, to get

"0001112227778" "first line"


as expected.

eelee+ enumerates this line, then does the same for a third input line, and concatenates the results, leaving something like this on the top of the stack:

[[0 '5] [1 ' ] [2 ' ] [3 ' ] [4 ' ] [5 ' ] [6 ' ] [7 ' ] [8 '6] [9 '7] [10 '8] [11 ' ] [12 ' ]
 [0 '2] [1 ' ] [2 ' ] [3 ' ] [4 '4] [5 ' ] [6 ' ] [7 ' ] [8 '1] [9 ' ] [10 ' ] [11 ' ] [12 '3]]


Now our stack is ["0001112227778" X] where X is the enumerated list above.

We flip each pair in X (Wf%), sort the pairs lexicographically ($), and leave the last 8 pairs -8&gt;. This gets us something like:

[['1 8] ['2 0] ['3 12] ['4 4] ['5 0] ['6 8] ['7 9] ['8 10]]


This works, because the sort places all the pairs with key ' (space) before all the digits in ascending order.

These are the "x-positions" of the characters 12345678 on the first and third lines: we only need to retrieve the characters from our (modified) second line that are vertically aligned with them.

To do this, we take each position (Wf=), index into the string we made earlier (\f=). We have "20610222" on the stack now: to add the dashes, first we split into segments of length two (2/), print the first segment without a newline ((o) and join the remaining segments with dashes ('-*).

EDIT: cool scan trick, Martin! Saved four bytes.

EDIT 2: saved two more bytes by replacing eelee+ with l+ee; this works, because the lines all have the same lengths, and list indexing in CJam is automatically modulo the list length, so the indices n+0, n+1, n+2... nicely map to 0, 1, 2... 

EDIT 3: Martin saved another byte in the final step of the process. Nice!