I certainly have some sympathy for your suggestion and I gave it a quick go, but in the end I'm inclined to push back. I don't much like the idea of a function which returns four separate things, and for which I can think of no sensible name. But more significantly, as soon as I put my refactoring hat on I wanted to modify all the other date2num craziness littered throughout the file. Factoring out these four lines in somewhat missing the point!