I happened to learn the other day that there is something called an ordinal date, which is composed of four digits representing the year and three digits representing the day of the year. These are often separated by a dash.
Just for learning purposes, I thought I would see how ordinal dates might be created and calculated with in a shortcut. Creating an ordinal date from a calendar date is simple:
Get Ordinal Date of Current Date.shortcut (21.6 KB)
Creating a calendar date from an ordinal date involves a bit more work. From what I understand, ordinal dates normally don’t include a time component.
Get Calendar Date from Ordinal Date.shortcut (22.6 KB)
Various approaches can be used to get the number of days between two ordinal dates, and the following is one example. The timing result was 50 milliseconds.
Ordinal Date Calculation.shortcut (23.5 KB)


