convert int32 dates to matlab date (datenum)
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi,
I work on netcdf4 file of a 2D model output. Date datatype is int32, how can I convert this into matlab date (datenume) or datetime?
Thanks.
댓글 수: 0
답변 (1개)
Stephen23
2023년 4월 3일
편집: Stephen23
2023년 4월 3일
"Date datatype is int32"
You did not tell us the most important information, which is the epoch and step size.
Assuming that those dates are UNIX format (ie. epoch 1st Jan 1970, 1 second steps) then use DATETIME like this:
U = uint32(1680508182)
D = datetime(U,'convertfrom','posix')
댓글 수: 1
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!