This adds more accurate utils for generating a snowflake from datetime. #91

Open
JDJGInc wants to merge 18 commits from JDJGInc/2.0 into 2.0
Showing only changes of commit 6a9083a504 - Show all commits

View File

@@ -1033,7 +1033,7 @@ def format_dt(dt: datetime.datetime, /, style: Optional[TimestampStyle] = None)
return f"<t:{int(dt.timestamp())}:{style}>"
def generate_snowflake(dt: datetime.datetime) -> int:
def generate_snowflake(dt: Optional[datetime.datetime] = None) -> int:
"""Returns a numeric snowflake pretending to be created at the given date but more accurate and random than time_snowflake.
Parameters