hdnpt / geartrack-website

Track Gearbest & Aliexpress packages using Spain Priority Line and other methods!
https://geartrack.pt
MIT License
82 stars 24 forks source link

Wrong calcutions for timestamps #75

Open moonlightz opened 1 year ago

moonlightz commented 1 year ago

Hi there. It appears there is something wrong with time calculations between dates. It is, at least, the second time I have spotted this problem.

2 examples spotted between 09/02/2003 afterrnoon and 10/02/2023 morning:

há 31 diasI  nbound in sorting center Fenggang Town
 ^^^^^ 10/01/2023 10:24
há 30 dias  Accepted by carrier  
^^^^^ 10/01/2023 07:18
há 29 dias   Outgoing at the sorting center  Fenggang Town
^^^^^ 10/01/2023 02:29 
há 31 dias  Incoming at the sorting center  Fenggang Town
^^^^^ 10/01/2023 10:24
há 30 dias  Accepted by the carrier
^^^^^ 10/01/2023 07:18
há 31 dias  Waiting for seller to ship
^^^^^ 09/01/2023 10:59

I am not sure what function that site uses to calc the time but it is obviously not doing the correct calc between the published time and the current time..

There might be also a problem when the published time and current time is less than 1 hour, making the site saying "Within" or "Dentro de" and we can't obviously calc negative times. There must be there another way to calc times.

carlosflorencio commented 1 year ago

Hey @moonlightz, thanks for reporting.

Yeah the current date logic isn't great, the main issue should be the timezone set when parsing the date from the carrier website. Some carriers are from Asia, and I don't know the exact country timezone to use. Other issue can be when the site with the tracking info, supports multiple carriers from multiple countries, we don't have a good method to detect the right timezone for the dates.

Can you share your tracking ID so that I can take a look into that issue in particular?

Regards

moonlightz commented 1 year ago

Just saw the reply now. It would be JA923927733PT. Yes, it would be probably the timezones.