Skip to content

Instantly share code, notes, and snippets.

View seumasmorrison's full-sized avatar

James Morrison seumasmorrison

View GitHub Profile
@seumasmorrison
seumasmorrison / datenum2datetime.py
Last active July 16, 2017 23:31 — forked from conradlee/datenum2datetime.py
Function for converting from matlab datenum to Python datetime
from datetime import datetime, timedelta
matlab_datenum = 731965.04835648148
def matlab_to_python_datetime(matlab_datenum):
return datetime.fromordinal(int(matlab_datenum)) + timedelta(days=matlab_datenum%1) - timedelta(days = 366)
matlab_to_python_datetime(matlab_datenum)
@seumasmorrison
seumasmorrison / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console