You don’t. They’re random, and no “official” explanation has ever been given. They have no correspondence to the Gregorian calendar.
In the original series, stardates were 4 digit numbers, that incremented fairly randomly as the three seasons went on.
In TNG, they made them five digits, with the first digit being 4 (supposedly because they were in the 24th century), and the second digit equal to the season number. So 1000 stardate units equaled one year in TNG-time.
When DS9 started in the middle of TNG‘s run, it used the TNG-numbering system, so the first season of DS9 had 46 as the first two numbers. When they got to 49 it rolled over to 50, even though it obviously wasn’t the 25th century yet.
Voyager continued this, picking up in the middle of DS9’s run.
Enterprise used the Gregorian Calendar rather than stardates for all log entries.