Here is a date function that should be able to do the job for you...

http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB2&Number=146619#Post146619