From https://gist.github.com/wpsmith/3670279#file-wps_soliloquy_dates-php