TN-DEVV / TN-rental

31 stars 14 forks source link

Time Left Time Zones #2

Open AQuincey opened 7 months ago

AQuincey commented 7 months ago

I noticed an error with this when renting for a number of days, if the person renting is on another time zone compared to the box, For example, I'm in the uk and our time zone is DD/MM/YYYY but my box is in america and its timezone is MM/DD/YYYY it gets confused and just maxes out the time left in the database to 1,712,426,360

TN-DEVV commented 7 months ago

The script get the host time, and i use os.time to get the time so it will give me the time in seconds since 1970 ! If you got time error check your host time

AQuincey commented 7 months ago

Thats the issue, if its using the os.time, that's different from my personal host time due to the timezone difference, so when I rent the vehicle, the script seems to get confused with what time as the format for timezones is different for certain countries.

TN-DEVV commented 7 months ago

I choose to work with os.time cause qbcore using it !! Even if you ban a player it use os.time ! So my suggestion is to just change your host time