Converting date number datetime

조회 수: 12 (최근 30일)
Simbarashe Chidzambwa
Simbarashe Chidzambwa 2022년 11월 18일
댓글: Stephen23 2022년 11월 21일
How do I convert date numbers for netcdf file with one year data on a 3-hr interval with the following time information?
time
Size: 2928x1
Dimensions: time
Datatype: double
Attributes:
units = 'hours since 1800-1-1 00:00:0.0'
long_name = 'Time'
standard_name = 'time'
axis = 'T'
coordinate_defines = 'start'
actual_range = [315552 324333]
delta_t = '0000-00-00 03:00:00'

답변 (1개)

Stephen23
Stephen23 2022년 11월 18일
편집: Stephen23 2022년 11월 18일
inp = [315552; 315555; 315558; 315561; 315564; 324333]
inp = 6×1
315552 315555 315558 315561 315564 324333
dt = datetime(1800,1,1) + hours(inp)
dt = 6×1 datetime array
01-Jan-1836 00:00:00 01-Jan-1836 03:00:00 01-Jan-1836 06:00:00 01-Jan-1836 09:00:00 01-Jan-1836 12:00:00 31-Dec-1836 21:00:00
  댓글 수: 2
Simbarashe Chidzambwa
Simbarashe Chidzambwa 2022년 11월 21일
Thank you Stephen for your help.
Stephen23
Stephen23 2022년 11월 21일
@Simbarashe Chidzambwa: you can show your thanks by accepting the answer that helped you most.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by