A package for converting fictional dates for the Blue Planet game
Project description
About the class
This class implements date conversion for the fictitous sci-fi world of Poseidon from the tabletop role-playing game Blue Planet published by Biohazard Games.
See the Blue Planet wiki for more about the Colonial calendar.
Usage
This is a sample session of using the PoseidonDateTime
class.
New objects are created with the fromcolonyformat
or fromisoformat
methods.
Pretty formatting of dates is with the colonyformat
or isoformat
methods.
The attributes p_year
, p_day
, p_hour
, p_minute
, and p_second
give the components of the Colonial datetime. Similarly, the attributes year
. day
, hour
, minute
, and second
give the components of the CE datetime.
You can use timedelta
objects changes the time; PoseidonDateTime.p_day_duration
is one Poseidon day.
>>> import poseidon_datetime as pdt
>>> import datetime as dt
>>> p_atlantis = pdt.PoseidonDateTime.fromisoformat('2124-08-07')
>>> p_atlantis.colonyformat()
'076.33 18:51:43'
>>> p_atlantis.colonyformat(include_time=True)
'076.33 18:51:43'
>>> p_atlantis.colonyformat(include_time=False)
'076.33'
>>> p_birthday = pdt.PoseidonDateTime.fromcolonyformat('023.99 28:15:00')
>>> p_birthday
PoseidonDateTime(2199, 1, 30, 23, 14, 22)
>>> p_birthday.isoformat()
'2199-01-30T23:14:22'
>>> p_birthday.p_day
23
>>> p_birthday.day
30
>>> p_after_birthday = p_birthday + dt.timedelta(days=1)
>>> p_after_birthday.isoformat()
'2199-01-31T23:14:22'
>>> p_after_birthday.colonyformat()
'024.99 22:14:17'
>>> p_after_birthday = p_birthday + pdt.PoseidonDateTime.p_day_duration
>>> p_after_birthday.colonyformat()
'024.99 28:15:00'
>>> p_after_birthday.isoformat()
'2199-02-01T05:15:05'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for poseidondatetime-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7dc3aa63db6816738bdb95ed1aec094e293f5073313775babb4f5823dd5f8936 |
|
MD5 | a0ff919c590b95ee5f82a3c131c0153a |
|
BLAKE2b-256 | 55e882cbf104008cfd6abba6e951b5112b7009c9c425847e8bcba8b4d6859b15 |