Skip to content

Instantly share code, notes, and snippets.

@jorgebastida
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save jorgebastida/e5db1b7f6c8d1cab7b8e to your computer and use it in GitHub Desktop.

Select an option

Save jorgebastida/e5db1b7f6c8d1cab7b8e to your computer and use it in GitHub Desktop.
import random
from datetime import datetime, timedelta
def random_date(start, end):
return datetime.fromtimestamp(random.randint(*map(int, (start.strftime('%s'), end.strftime('%s')))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment