They are not pretty formulas, but you can find the one that I think will work for you at the top of this page:

http://www.cpearson.com/excel/DateTimeWS.htm