Let
x=7.369030000162731e+05
x is a matlab date and it is equal to
27.07.2017 00:00:01.406
I want to remove the milliseconds from it (ie. .406)
To do this I convert it to datestr with 'dd.mm.yyyy HH:MM:SS' format and then again to datenum
datenum(datestr(x,'dd.mm.yyyy HH:MM:SS'))
Is there a simpler way to do this.
If you want the manual approach:
y = floor(x*86400)/86400;
because serial date numbers are measured in days, and 86400 is the number of seconds in a day.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With