2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

respect timezone when handeling git commit times (#4997)

This commit is contained in:
Matthias Mair 2023-06-08 14:00:54 +02:00 committed by GitHub
parent bae1c239e8
commit e807339c55
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,10 +3,11 @@
Provides information on the current InvenTree version Provides information on the current InvenTree version
""" """
import datetime
import os import os
import pathlib import pathlib
import re import re
from datetime import datetime as dt
from datetime import timedelta as td
import django import django
@ -126,4 +127,6 @@ def inventreeCommitDate():
if main_commit is None: if main_commit is None:
return None return None
return str(datetime.datetime.fromtimestamp(main_commit.commit_time).date())
commit_dt = dt.fromtimestamp(main_commit.commit_time) + td(seconds=main_commit.commit_timezone)
return str(commit_dt.date())