Skip to content

Instantly share code, notes, and snippets.

@qinshulei
Last active September 23, 2016 06:55
Show Gist options
  • Save qinshulei/5c4ffcb610265113d439ece7787c6c8a to your computer and use it in GitHub Desktop.
Save qinshulei/5c4ffcb610265113d439ece7787c6c8a to your computer and use it in GitHub Desktop.
get all friday by python.
#!/usr/bin/python
# -*- coding: utf-8 -*-
from datetime import date, timedelta as td
d1 = date(2015, 1, 2)
d2 = date(2016, 12, 31)
delta = d2 - d1
for i in range(0, delta.days + 1, 7):
print d1 + td(days=i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment