The stardate system used in the Star Trek franchise can sometimes feel like a random selection of numbers, but there is some degree of meaning and calculation involved. When first devising and conceptualizing the futuristic world of Star Trek, Gene Roddenberry decided that the advent of long-range space travel would necessitate a brand new way of measuring time, instead of the standard Gregorian calendar used in the real world. In 1988's Inside Star Trek documentary, original series researcher, Kellam de Forest, revealed that he took inspiration from the 16th century Julian system, which has been implemented by astronomers ever since. Featuring a way of counting days, ignoring leap years and removing the AD and BC system, the Julian method formed the foundation for Star Trek's stardates.
The inspiration for the stardate system may have been simple enough, but applying it to the scripts proved far more complicated, and the exact correlation between Star Trek time and real-world time has changed throughout the various TV series and movie iterations. For the original Star Trek series, the show's bible instructed writers to pick four numbers and a decimal, with the final digit roughly representing a tenth of a day. The example given is that if noon today was 1313.5, noon tomorrow would be 1314.5.
However, it's important to note that Roddenberry's initial system of dating was intentionally vague, with pilot episode writer, Samuel A. Peeples, revealing that the stardates weren't designed to be decipherable. Roddenberry was initially reluctant to pin Star Trek down to a specific time, so the stardate increments were uneven from episode to episode. Unfortunately, Star Trek encountered a problem when the series first began to air - the network were showing the episodes out of order. This meant that while the stardates were originally supposed to increase as the series progressed, they actually fluctuated wildly. Roddenberry provided an in-narrative explanation for this phenomenon, claiming that stardates took into account the Enterprise's speed and position in the galaxy, and therefore were relative to both space and time.
This somewhat clunky system was overhauled for Star Trek: The Next Generation. As well as adding an extra digit, The Next Generation's writer's guide reveals that a more structured way of calculating stardates was implemented. The first number indicates the century (4 = 24th), the second number represents the season number (1 = season 1) and the following two digits would be largely random and vary with each episode, much like in the original Star Trek series. The fifth digit functioned as a day counter, while, as in Roddenberry's original model, the decimal still represented a tenth of a day. This pattern was retained for both Deep Space Nine and Star Trek: Voyager.
When J. J. Abrams rebooted the Star Trek movie series and splintered into the Kelvin timeline, a brand new dating system was introduced that bore a stronger resemblance to the real-world model. As revealed in the revised Star Trek Encyclopedia, the first two digits would represent century (22 = 23rd century), and the second two digits would calculate the year within that century. The 2009 movie also added more numbers after the decimal point, and these would indicate the day of the year. Therefore, 2235.78 would mean the 78th day of the 35th year of the 23rd century.
Beginning with Star Trek: Discovery, CBS are now in the process of launching a whole new world of content set within the Star Trek universe that will include Star Trek: Picard and a Section 31 spinoff. Looking at the stardates used so far in Star Trek: Discovery, it appears that the franchise will come full circle, returning to the stardate system used in Star Trek: The Original Series. However, with Star Trek: Discovery season 2 ending in the far future, the entire stardate system could become redundant when the show returns.
Star Trek: Picard is set to premiere in early 2020 on CBS All Access.
Sources: Inside Star Trek, Gene Roddenberry: The Myth & The Man Behind Star Trek, The Making of Star Trek, Star Trek Encyclopedia