If you have some table with date values saved as int's this procedure might be a simple solution.