The chart below should help you get rid of the dates that are invalid because they are too close to the earthquakes.

 
Invalid Dates
For EQ's of Mag. 4.5-5.9 areFor EQ's of Mag. 6.0-6.9 areFor EQ's of Mag. 7.0-up are
1 month before & after EQ date6 months before & after EQ date1 year before & after EQ date

Confused yet? Don't worry. Here's an example for help. Let's say that you had an Earthquake date of Jun. 15, 0998 and magnitude of 6.5. You look at the chart above which says that earthquakes with Mag. of 6.0-6.9 (like this one) have invalid dates of 6 months before & after the earthquake date. What?!? OK, this means that if you pick a random date within 6 months of this earthquake's date (which happens to be Jan. 15, 0998-Jan. 15, 0999), you can't use it. So if you pick a random date of Mar. 08, 0998 you wouldn't be able to jot it down as one of the random dates you're using for this project.