Filter löschen
Filter löschen

How to convert date to day number?

7 Ansichten (letzte 30 Tage)
miguel angel torres quintero
Kommentiert: Jan am 1 Aug. 2017
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 Kommentare
James Tursa
James Tursa am 28 Jul. 2017
Bearbeitet: per isakson am 28 Jul. 2017
@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 am 1 Aug. 2017
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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Steven Lord
Steven Lord am 28 Jul. 2017
dt = datetime('2012-January-12')
day(dt, 'dayofyear')
  2 Kommentare
Andrei Bobrov
Andrei Bobrov am 28 Jul. 2017
+1
Peter Perkins
Peter Perkins am 1 Aug. 2017
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

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by