From 5604fac1b23e4d3fd9f1884cd7169bd698e2cf45 Mon Sep 17 00:00:00 2001 From: fram3d Date: Thu, 5 Oct 2023 02:19:52 +0200 Subject: [PATCH] readjust step in predict and add dateformating function --- .gitignore | 1 + freeriders/functions.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index bf907f1..ac5c484 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycacahe__/* freeriders/__pycacahe__/* +instance/ diff --git a/freeriders/functions.py b/freeriders/functions.py index 2a7e083..4c53f99 100644 --- a/freeriders/functions.py +++ b/freeriders/functions.py @@ -1,4 +1,9 @@ import time +import datetime + +def datetounix(day, month, year, hour, minute, second): + seconds = datetime.datetime(year, month, day, hour, minute, second).timestamp() + return int(seconds) def formatprefix2(number): return "{:02d}".format(number) @@ -7,10 +12,10 @@ def formatprefix10(number): return "{:010d}".format(number) def predict(timestamp): - base_ticket = 4339636 - base_timestamp = 1694003498 - step = 8 + base_ticket = 7157662 + base_timestamp = 1695887564 + step = 0.688 ticket = base_ticket + (timestamp - base_timestamp) * step - return ticket + return int(ticket)