MATLAB: How to convert runtime into datetime

MATLABrun time

I have a this type of run time data
142369240.800000
142369240.800000
142369241
142369241.200000
142369241.200000
I am using the below datetime option to convert into d-MMM-y HH:mm:ss.sss, but getting results in CE. Please can you help us out? thanks
t = datetime(142369240.800000,'ConvertFrom','datenum','Format','d-MMM-y HH:mm:ss.sss')
t =
datetime
389793 CE

Best Answer

There's a Note in the description of the Format property on the documentation page for datetime that states "Datetime values later than 144683 years CE or before 140743 BCE display only the year numbers, regardless of the specified Format value."
You could break this up into year, month, and day values if your value actually represents a date.
>> dt1 = datetime(142369240.800000, 'ConvertFrom' ,'datenum');
>> [y, m, d] = ymd(dt1)
y =
389793
m =
9
d =
26
But since you mentioned runtime, I'm guessing your number doesn't represent a date. Does it represent a number of seconds, milliseconds, microseconds, or the like? If so you probably don't want to create a datetime but instead want a duration.
duSeconds = seconds(142369240.8)
years(duSeconds) % about four and a half years