Skip to content

Instantly share code, notes, and snippets.

@lmgeorge
Created October 1, 2020 19:22
Show Gist options
  • Save lmgeorge/caf110cc2ac36af28d80aa3600025209 to your computer and use it in GitHub Desktop.
Save lmgeorge/caf110cc2ac36af28d80aa3600025209 to your computer and use it in GitHub Desktop.
Markdown formatted code blocks showing how to use dates

Python

from datetime import datetime
timestamp = datetime.utcnow().strftime('%Y-%m-%dT%H-%M-%S')
# '2020-03019T19-53-07'

R

timestamp <- format(Sys.time(), format="%FT%H-%M-%S", tz="UTC")
# [1] "2020-03-19T20-06-25"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment