Skip to content

Instantly share code, notes, and snippets.

@AndrewHazelden
Last active March 1, 2016 22:23
Show Gist options
  • Save AndrewHazelden/f9186b76473344bbe493 to your computer and use it in GitHub Desktop.
Save AndrewHazelden/f9186b76473344bbe493 to your computer and use it in GitHub Desktop.
Use Python to generate a date and time stamp as a string
import datetime
# Get the current time
now = datetime.datetime.now()
# Make a note of the date and time in a string
# Example: 2015-12-05 12:34:24 PM
textDocument = '# Scene Generated: ' + now.strftime('%Y-%m-%d %H:%M:%S %p') + '\n'
print textDocument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment