How many “ticks” until your opportunity closes?

I recently had a requirement to show the number of days before an opportunity was due to close, this turned out to be slightly more complex than it first sounded. So, I thought I’d create a quick blog post to explain how I achieved this requirement.