Convert date from number to format in matllab
Show older comments
I have original time and date format as mentioned below:
2/17/2020 9:48:18 AM
I did forecasting using this , and after forecasting output date in the plot appears in number format like :
43878.4085416667
How can i convert it back to original date and time format ?
9 Comments
Walter Roberson
on 31 Jan 2021
How did you do the forecasting with it?
Did you convert the date/time t numeric using datenum() ? If so, only do that if the forecasting routines do not support datetime objects, and otherwise use datetime() .
NN
on 31 Jan 2021
NN
on 31 Jan 2021
Walter Roberson
on 31 Jan 2021
date_num2 = testdates + seconds(Data{:,2});
Now if possible use date_num2 in the forecasting, and plot with
plot(date_num2, in)
NN
on 31 Jan 2021
How are you generating the date value from forecasting ?
The values near 43878.4085416667 suggest to me,
datetime(43878.4085416667, 'convertfrom', 'excel')
but why are you getting Excel dates at all???
NN
on 31 Jan 2021
NN
on 31 Jan 2021
Accepted Answer
More Answers (0)
Categories
Find more on Calendar in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
