Welcome to imperial-dateutil’s documentation!¶
Warning
Heretics, X̶e̶n̶o̶s̶, and Chaos are not allowed to use this util.

Note
The Emperor protects always and forever. He is the Omnissiah and will always live, always protect, always watch. He will protect all loyal to the Imperium and it is an honor to fight and die in the name of the emperor.
A utility to use Imperial Dating System(include Era Indomitus Dating System)
$ pip install imperial-dateutil
Imperial Dating System¶
Usage¶
After praying to Machine-God Omnisiah, then command this Lingua-technis to your Cogitator.
>>> from imperial_dateutil import ImperialDatingSystem
>>> from datetime import datetime, timedelta
>>> d_t = ImperialDatingSystem(0, 123, 456, 41)
<check_digit=0, year_fraction=123, year=456, millennium=M41>
>>> print(d_t)
0123456.M41
>>> print(ImperialDatingSystem(0, 123, 456, 41) + ImperialDatingSystem(0, 123, 456, 41))
0246912.M82
>>> print(ImperialDatingSystem(0, 123, 456, 41) + timedelta(days=9000))
0780480.M41
>>> print(timedelta(hours=8.8) + ImperialDatingSystem(0, 123, 456, 41))
0124456.M41
>>> print(ImperialDatingSystem.now())
0995019.M3
>>> ImperialDatingSystem(0 ,123, 456, 41) == ImperialDatingSystem(0, 123, 456, 41)
True
>>> ImperialDatingSystem(0 ,123, 457, 41) > ImperialDatingSystem(0, 123, 456, 41)
True
>>> print(ImperialDatingSystem.from_gregorian(datetime(2005, 7, 18, 16)))
0549005.M3
API¶
-
class
imperial_dateutil.core.imperial.
ImperialDatingSystem
(check_number, year_fraction, year, millennium)[source]¶ Bases:
object
The Imperial Dating System of the Imperium of Man, also known as the Imperial Calendar, is fairly complex in nature, and has been structured so as to deal with the vast amount of recorded history that exists in the 41st Millenium and the massive distances between settled human worlds, which can lead to long periods of isolation.
Also the vagaries and time-warping effects of the Immaterium can make it almost impossible to keep accurate track of time over long journeys.
The Imperium has developed its own method of recording dates, which needs a bit of explanation. Most importantly, the years are always Anno Domini (A.D.) using the numbering system of our own present-day Gregorian Calendar, so the dates themselves are the ones that we are familiar with now.
A typical date as Imperial scholars write it would look something like 0.123.456.M41. This date can be divided up so that each part is explained separately below:
Check Number
Year Fraction
Year
Millennium
0
123
456
M41
Following the birth of the Great Rift and the start of the Era Indomitus, temporal anomalies spread across the galaxy making the use of a universal dating system extremely difficult as different Imperial worlds began to experience the passage of time at different subjective rates.
A new, more localised dating system came into existence that was different for each world. It used the birth of the Great Rift as the standard event from which all time was calculated, either before or after its creation.
- Copyright
this descriptions are copied from https://warhammer40k.fandom.com/wiki/Imperial_Dating_System
- Parameters
check_number (int) – The check number refers to the accuracy of a given date, which is required for clarity due to the common distortions of subjective linear time that occur while travelling within the Warp, and inaccuracies in timing on remote or isolated Imperial worlds and star systems.
year_fraction (int) – For record-keeping, each year is divided into 1000 equal parts, numbered 001-000, rather than months or weeks. Note that this system is not generally used by Imperial citizens in everyday life, but is simply for administrative use by the Adeptus Terra.
year (int) – This is the year within the millennium, running from 001-999.
millennium (int) – This is the millennium since the birth of the ancient human religious figure Jesus Christ in which the event took place.
-
classmethod
from_gregorian
(t, check_number=0)[source]¶ A function returns ImperialDatingSystem of given gregorian date/datetime
- Parameters
t (datetime.datetime or datetime.date) – Gregorian based datetime or date
check_number – accuracy of t, numbered 0-9
- Returns
Imperial time format of given t
Indices and tables¶
Note
GW, Games Workshop, Citadel, Black Library, Forge World, Warhammer, the Twin-tailed Comet logo, Warhammer 40,000, the ‘Aquila’ Double-headed Eagle logo, Space Marine, 40K, 40,000, Warhammer Age of Sigmar, Battletome, Stormcast Eternals, White Dwarf, Blood Bowl, Necromunda, Space Hulk, Battlefleet Gothic, Dreadfleet, Mordheim, Inquisitor, Warmaster, Epic, Gorkamorka, and all associated logos, illustrations, images, names, creatures, races, vehicles, locations, weapons, characters, and the distinctive likenesses thereof, are either ® or TM, and/or © Games Workshop Limited, variably registered around the world. All Rights Reserved.