Hey guys, I was on a Facebook page where people were asking how to convert/create Imperial Dates, after reading how to do it, I figured it was easy enough to turn into a script and put it here for anyone to use!

Just select the source, hour, Day, Month, and type a Year and hit Go!

Source/Check Number:

Hour:

Day:

Month:

Year:

If you have any suggestions or comments, leave them below or let me know via email. me (at) kingsley-muir.com

22 thoughts on “40k – Imperial Date Calculator”

  1. I have discovered a flaw in either the calculation used. Any time/date after 3PM on December 30th returns a work-cycle greater than 1000. It should cycle back to 001 and iterate the year at that point. Granted, this means the Imperial Year starts 33 hours before our current year, but that is what the calculator says.

  2. Just to note a bug in the calculator, it is not accounting for leap years.

    For example, today 12 of November is the 317th day of the year as 2020 is a leap year. The calculator however is treating it as day 316, which would be accurate for non-leap years.

    Just remember when accounting for it, that any potential leap year falling on a century mark has to also be divisible by 400 to be a leap year.

  3. There is still a bug with determining the date at the end of the year.
    Source/Check Number:
    Terra

    Hour:
    9pm / 2100h

    Day:
    31

    Month:
    December

    Year:
    2020

    Calculate
    The Imperial Date is: 01001020.M03

  4. Ok I’ve found the problem.

    The 40k calendar doesn’t account for leap years at all. – I’ve made this calendar account for leap years using our current understanding of leap years.

    Therefore the Makr constant was also wrong, as it was attempting to work out the 1000 divisions of 365 days. There is another one to account for leap years also.

  5. This is a great tool! My wife is going to be so happy now I can re-home that rot-smelling floaty skull that I currently have to use to transcribe the Imperial time stamp for official communicae.

  6. Hi Kingsley I think there is a slight issue with your date for instance the date should go from 001 to 000 but if I put 1st of Jan 2005 and first hour for instance I get the date 000, while if I put the date as the last hour of dec 31 then I get 997 here I should get 000. As you are using hours the first hour is in essence 0x1000/8760 rounded down plus 1 or 0 or 001 while the last hour should be 8759×1000/8760+1 or 1000 or 000. I didnt check leak years there you have to have a slightly different calculation.

    1. I will have to look into it! Thanks for that.

      I might be guessing that “lower” dates don’t quite 100% work, as 40k is supposed to be year 40,000 so they may not have had the math work correctly for “a really really long time ago” dates.

    2. I don’t think that’s correct. While the last year of the millennium is 000, when it comes to time, imperial date uses a fraction system, and 000 is absolutely the start of the year, not the end.

      000 means 000/1000 into the year. So Jan 1st, 00:00:00.
      001 means 001/1000 into the year. So Jan 1st, 08:45:36.

      2005 was not a leap year, which means the year had 24*365=8760 hours in it.

      Jan 1st, 01:00:00 = 000,14, which means 000 as that number is always rounded down as described in:
      https://warhammer40k.fandom.com/wiki/Imperial_Dating_System#Year_Fraction
      So the calculator is correct.

      Dec 31, 23:00:00 = 8759/8760 * 1000 = 999.88, which means 999, not 000, but not 997 either.
      So the calculator is wrong there.

  7. Actually, I quoted the wrong source.

    https://wh40k.lexicanum.com/wiki/Imperial_Dating_System is a better source since fractions of years are indeed noted from 000 to 999, as stated. Not 001 to 000 as for the year themselves.

    Additionally, the constant given on both sites (0.11407955) is wrong for translating contemporary dates with years of 365 days of 24 hours.

    The constant should be:

    For a regular year: 1/(365*24*0.001) = 1/8.76 = ~0.1141552511415525
    For a leap year: 1/(366*24*0.001) = 1/8.784 = ~0.1138433515482696

    Cheers.

  8. Interestingly, the constant provided is for years composed of 365.2422074479314 days. Which is exactly the number of revolution of the earth on itself (days) in one revolution of the earth around the sun (years).

    But that’s completely useless because, obviously, we don’t use a calendar of all equal years of 365.25 days, which is why the calculation is off both both leap years and regular years. We have 3 years of 365 days, followed by one of 366 days. That averages to 365.25, but on a given year, it’s either 365 or 366, never 365.25, making the provided constant useless.

    Hope this helps.

Leave a Reply

Your email address will not be published. Required fields are marked *