필터 지우기
필터 지우기

How to convert date to day number?

조회 수: 7 (최근 30일)
miguel angel torres quintero
miguel angel torres quintero 2017년 7월 28일
댓글: Jan 2017년 8월 1일
Hello I wanna convert a date to day number. For example: 2012-Junuary-12 is equal to 12 days (we are talking about 12 days passed of 365 day) I don´t refer to Julian Day.
  댓글 수: 3
James Tursa
James Tursa 2017년 7월 28일
편집: per isakson 2017년 7월 28일
@Jan: Julian Date and Day Of Year are two different things. Julian Date has a very specific meaning. E.g. from the USNO:
Or if you prefer Wiki
Jan
Jan 2017년 8월 1일
Thanks, James. I hoped that the OP explain maore details also, e.g. how the input is represented and why he mentions the Julian Day.

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

답변 (1개)

Steven Lord
Steven Lord 2017년 7월 28일
dt = datetime('2012-January-12')
day(dt, 'dayofyear')
  댓글 수: 2
Andrei Bobrov
Andrei Bobrov 2017년 7월 28일
+1
Peter Perkins
Peter Perkins 2017년 8월 1일
And also:
>> dt = datetime(2012,1:3,12)
dt =
1×3 datetime array
12-Jan-2012 12-Feb-2012 12-Mar-2012
>> dt.Format = 'yyyy:D'
dt =
1×3 datetime array
2012:12 2012:43 2012:72

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

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by