Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created April 25, 2020 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniruddha27/63468c406b5170b1a5e3cd4eb07d852d to your computer and use it in GitHub Desktop.
Save aniruddha27/63468c406b5170b1a5e3cd4eb07d852d to your computer and use it in GitHub Desktop.
# date in string format
d1 = datetime.now()
# string format for date
print(d1.ctime())
# slicing to extract date
print(d1.ctime()[:10])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment