Hi @calebingersoll
The above code will break if you have an incorrect value, or if your server PHP version does not have the datetime functionality (I think its v5.3 and above)
A for the code you have posted, have you debugged it? Have you tested the variable $onsale_date?