Last active
September 7, 2017 14:36
-
-
Save andykuszyk/dd64413c1a5d0ccd7b4f50fee32e9b37 to your computer and use it in GitHub Desktop.
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 argparse | |
import datetime | |
import time | |
def date(arg): | |
return datetime.date.fromtimestamp(time.mktime(time.strptime(arg, '%d/%m/%Y'))) | |
if __name__ == '__main__': | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--date', type=date) | |
args = parser.parse_args() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment