Skip to content

Instantly share code, notes, and snippets.

View disulfidebond's full-sized avatar

disulfidebond disulfidebond

  • UWisconsin-Madison
  • Madison, WI
View GitHub Profile
@disulfidebond
disulfidebond / timestamp-bash.sh
Created January 25, 2019 18:22 — forked from scienceystuff/timestamp-bash.sh
timestamp in bash
#!/bin/sh
date
# outputs Fri Jan 25 12:10:33 CST 2019
# alternative: add to bash_profile
timestamp() {
date +"%T"
}
@disulfidebond
disulfidebond / timestamp-py.py
Created January 25, 2019 18:22 — forked from scienceystuff/timestamp-py.py
timestamp in python
import time
import datetime
# credit: squiguy https://stackoverflow.com/a/13891070
t_stamp = time.time()
t_stamp_string = datetime.datetime.fromtimestamp(t_stamp).strftime('%Y-%m-%d %H:%M:%S')
# output: 2019-01-25 12:06:02
t_stamp_string = datetime.datetime.fromtimestamp(t_stamp).strftime('%Y.%m.%d.%H.%M.%S')
# output: 2019.01.25.12.07.16