Created
February 22, 2019 12:50
-
-
Save Godisemo/a4cb267055753d494350e2f357ac6ef6 to your computer and use it in GitHub Desktop.
Matlab date conversion in Julia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MATLAB_EPOCH = Dates.DateTime(-1,12,31) | |
date2num(d::Dates.DateTime) = Dates.value(d-MATLAB_EPOCH)/(1000*60*60*24) | |
num2date(n::Number) = MATLAB_EPOCH + Dates.Millisecond(round(Int64, n*1000*60*60*24)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment