On Star Trek, we hear a lot of "stardates," meant to mark some futuristic date. An example is stardate 47457.1, which is Captain Picard's birthday. The weird thing is that stardate 47457.1 is either the equivalent June 16th, November 4th, January 8th, or January 10th, depending on how you count. Let's go deep-nerd on this.
The Original Series
In the original Trek TV series, stardates were, in a word, bogus. In the series bible, the Star Trek Guide, writers were basically told to wing it. Here's a snippet (emphasis added):
Pick any combination of four numbers plus a percentage point [ed. note: tenths digit], use it as your story's stardate. For example, 1313.5 is twelve o'clock noon of one day and 1314.5 would be noon of the next day. Each percentage point is roughly equivalent to one-tenth of one day. The progression of stardates in your script should remain constant but don't worry about whether or not there is a progression from other scripts. Stardates are a mathematical formula which varies depending on location in the galaxy, velocity of travel, and other factors, can vary widely from episode to episode.
This obviously wasn't thought through very well, as it boils down to "Pick a number and stay near it." Show creator Gene Roddenberry later said:
When we began making episodes, we would use a stardate such as 2317 one week, and then a week later when we made the next episode we would move the star date up to 2942, and so on. Unfortunately, however, the episodes are not aired in the same order in which we filmed them. So we began to get complaints from the viewers, asking, "How come one week the star date is 2891, the next week it's 2337, and then the week after it's 3414?"
He then went on to explain that the whole "location in the galaxy, velocity of travel, and other factors" thing was a hedge to cover up the fact that the dates simply weren't consistent to begin with, even if the episodes had aired in order.
The Next Generation
In Star Trek: The Next Generation, things got a bit more consistent. In the original TNG Writer's/Director's Guide, the show-runners devised a sensible formula with a reasonable level of continuity. Here it is:
A stardate is a five-digit number followed by a decimal point and one more digit. Example: "41254.7." The first two digits of the stardate are always "41." The 4 stands for 24th century, the 1 indicates first season. The additional three leading digits will progress unevenly during the course of the season from 000 to 999. The digit following the decimal point is generally regarded as a day counter.
It's interesting to note, then, that the duration of a TNG season is 1,000 days. Good thing they were on a continuing mission rather than a five-year one.
Both Star Trek: Deep Space 9 and Star Trek: Voyager continued using the TNG style of Stardates, and the movie Star Trek Nemesis followed suit.
As you might expect, early on in TNG, the writers sometimes goofed. A prime example is Tasha Yar's death, which occurred circa Stardate 41601.3, but she was alive in a previous episode with the (later) Stardate 41997.7. Oops. By 1992, the writers had revised their guidelines to be iron-clad:
A Stardate is a five-digit number followed by a decimal point and one more digit. Example: "46254.7". The first two digits of the Stardate are "46." The 4 stands for the 24th Century, the 6 indicates sixth season. The following three digits will progress consecutively during the course of the season from 000 to 999. The digit following the decimal point counts tenths of a day. Stardate 45254.4, therefore, represents the noon hour on the 254th "day" of the fifth season. Because Stardates in the 24th Century are based on a complex mathematical formula, a precise correlation to Earth-based dating systems is not possible.
Despite explicitly stating that correlation to Earth-based dates is not possible, that hasn't stopped people from trying.
Just when things were basically making sense, they changed again. From an exhaustive and brilliant article on Memory Alpha, here's an explanation of the reboot (J.J. Abrams-directed) movies' treatment of stardates (emphasis added):
The stardate format from the latest film series is credited to screenwriters Roberto Orci and Alex Kurtzman. According to Orci, they "used the system where, for example, 2233.45 or whatever means 23rd century, 33rd year of that century, and the .45 indicates the day of the year out of 365 days." During a Q&A session, Orci restated that a stardate is "the year, as in 2233, with the month and day expressed as a decimal point from .1 to .365 (as in the 365 days of the year)." He posted a similar reply on Twitter: "star date=standard year, with decimal representing day of year from 1-365." The new stardates are similar to the ordinal dates of ISO 8601, which express the first day of 2260 as 2260-001, and the last as 2260-366. Orci hasn't clarified whether leap days increase the count to .366, which would be expected if the years are Gregorian. When asked about 2230.06 and 2233.04 from the Star Trek screenplay, with only one leading zero instead of two or none, he replied that it could have been an error. IDW's Star Trek: Timelines show the latter number as 2233.4.
Long Story Short
There is no one answer to how stardates work, aside from saying that they don't. They're inconsistent series-to-series, and even within a given series, the writers often mixed things up. With Roddenberry trying to retcon the system's continuity even in TOS, perhaps it's appropriate that the system continues to be more than a little mixed up. Time-tracking throughout the galaxy is a hard problem; give 'em some slack.
If you're curious about examples of various Stardates (and even more discussion of this issue), check out Memory Alpha's stardate page. Trust me, once you've read that, you'll never want to speak of this subject again. If you do, read this page for a deeply unofficial (but supremely logical) system of decimal time. Oh, and don't forget the time the French made a 10-hour day—another attempt to create decimal time that led to total confusion.