Question
How i can convert the list of date/time in to my local date format and let me know which format is it? Example: From 1992.752225 1992.765914 1992.779603 ................2018.460643 to dd/mm/yyyy or 'dd-mm-yyyy HH:MM:SS'
Expert Answer
John Williams
PhD Expert
Answered Aug 17, 2026
d = [1992.752225; 1992.765914; 1992.779603; 2018.460643]; datetime(floor(d), 1, 1) + years(mod(d,1))
However, I would be concerned about the difference between years() -- which uses fixed-length years -- and calendar years.
fd = floor(d); datetime(fd, 1, 1) + (d-fd) .* days(365+leapyear(fd))
The similarities of the first three times in the first version suggest to me that the time system is using fixed length years --- but that can make it difficult to figure out how to handle the leapyear. Some time systems like that just remove the leap day; if you are using one of those then for entries for which leapyear() is true and the date is after Feb 28, you have to add one day.
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related matlab Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →