Created
August 5, 2020 17:04
-
-
Save drbh/f5cd7d6ec5327b8eee77e73404adff6f to your computer and use it in GitHub Desktop.
When you only wanna update users on even weeks of the year
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
# get the week of the year | |
week_number = datetime.datetime.now().isocalendar()[1] | |
print(f"Its the {week_number} week of the year") | |
# this is True every other week | |
should_update_users = week_number % 2 == 0 | |
if should_update_users: | |
print("update users") | |
else: | |
print("dont update users") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment