datetime - MATLAB date format -


i'm trying convert date string date number using dtstr2dtnummx (three time faster datenum), input

dtstr2dtnummx({'2010-12-12 12:21:13.101'},'yyyy-mm-dd hh:mm:ss.fff')

and input

dtstr2dtnummx({'2010-12-12 12:21:13.121'},'yyyy-mm-dd hh:mm:ss.fff')

getting same output. used following tutorial build date format.

ahh sorry, updated

the corresponding format of 'fff' in datenum 'sss' in dtstr2dtnummx, can seen in cnv2icudf.m line #126. end result is:

>> d1 = dtstr2dtnummx({'2010-12-12 12:21:13.101'},'yyyy-mm-dd hh:mm:ss.sss') d1 =       734484.514734965  >> d2 = dtstr2dtnummx({'2010-12-12 12:21:13.121'},'yyyy-mm-dd hh:mm:ss.sss') d2 =       734484.514735197  >> % double check results - difference should equal 0.02 secs: >> secsperday = 24*60*60; >> timediff = secsperday * (d2-d1) timediff =       0.019996 

i have posted article on http://undocumentedmatlab.com/blog/datenum-performance/


Comments