Skip to content

Instantly share code, notes, and snippets.

@amarinelli
Last active August 29, 2015 14:04
Show Gist options
  • Save amarinelli/f786f13d2f259be88782 to your computer and use it in GitHub Desktop.
Save amarinelli/f786f13d2f259be88782 to your computer and use it in GitHub Desktop.
Take 8 character string ("20140717") and turn into type Date
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