Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created April 25, 2020 10:18
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/0786d49e3d3b99b3f51dc6ca1ed8a781 to your computer and use it in GitHub Desktop.
Save aniruddha27/0786d49e3d3b99b3f51dc6ca1ed8a781 to your computer and use it in GitHub Desktop.
# strftime
d1 = datetime.now()
print('Datetime object :',d1)
new_date = d1.strftime('%d/%m/%Y %H:%M')
print('Formatted date :',new_date)
print(type(new_date))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment