I sold my rental on 12/2017, but escrow closed on 1/2018. Do I have a choice of what year I claim capital gain on?

I sold my rental on 12/2017, but escrow closed on 1/2018. Do I have a choice of what year I claim capital gain on?