Last active
August 29, 2015 14:04
-
-
Save amarinelli/f786f13d2f259be88782 to your computer and use it in GitHub Desktop.
Take 8 character string ("20140717") and turn into type Date
This file contains 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
def CalcDate(string): | |
if (len(string) <> 8): | |
return | |
else: | |
return "{0}-{1}-{2}".format(string[:4], string[4:6], string[6:]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment