get_date almost useful!

This was very, very tricky to get right. SET and IF are hyper sensitive
to subtle changes in nesting and brackets and quotes. Moral: reduce
bracketing to the absolute minimum necessary.