Converting fractional doy (eg. 208.572917) to a date with mm/dd/yyyy HH:MM
이전 댓글 표시
I have a set of data that includes doy for the year, 2013, but the doy are fractions such that July 27th at 13:45 would be represented as 208.5729167. I would like to convert this to a visual that is easier to interpret such as mm/dd/yyyy HH:MM. I've searched around and the closest function I've found converts a date to doy.
Thanks in advance
채택된 답변
추가 답변 (1개)
Peter Perkins
2015년 7월 27일
In R2014b or later, you can use datetime and duration:
>> d = datetime(2013,1,1) + days(208.5729167)
d =
28-Jul-2013 13:45:00
But bear in mind that in double precision, hours, minutes, and seconds are not exactly representable as fractions of days. Hope this helps.
카테고리
도움말 센터 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!