create timeseries from first january to 31. December

1 view (last 30 days)
Hi ,
I am trying to create a vector of timeseries with only months and days. No Year! I tried a few funktions but it requires to have a year. Somehow it is difficult to not include the year.
I appreciate any help.
  1 Comment
dpb
dpb on 14 Aug 2018
That's so at present, yes. Closest so far is duration class that can be such, but even it requires a year to handle calendar durations owig to leap years messing things up.
You can set the display format to not show years and pretend they're not there visually but unfortunately all coding has to include them to get comparisons, etc., to work.

Sign in to comment.

Answers (1)

Steven Lord
Steven Lord on 15 Aug 2018
I don't believe that's possible. How many days long is the vector from January 1st to December 31st? That's a simple question, right?
The answer to that simple question depends on whether the year containing those two dates is a leap year, a non-leap year, 1712 in Sweden, or perhaps 1753 in Sweden. [I'm not really sure off the top of my head how datetime handles those last two scenarios.]

Categories

Find more on Dates and Time in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!