Estimated Arrival Time
joschiservice opened this issue · 4 comments
Hello,
Is there a possibility to get the estimated arrival time?
Couldn't you do this by doing...
DateTime ArrivalTime = data.CommonValues.GameTime.Date + data.NavigationValues.NavigationTime
You will have to convert NavigationTime from a float to a TimeSpan either TimeSpan.FromHours or FromMinutes (Not sure how its presented, never used it) scrap this last line, see below!
But then... this should give you the ETA including the Day - Which then you can parse into a readable format
--- Edit ---
I decided to be kind, this code works for C#.
DateTime ArrivalTime = (data.CommonValues.GameTime.Date).Add(TimeSpan.FromSeconds(data.NavigationValues.NavigationTime));
It gives you the ETA in this format: 25/01/0001 17:28:00
You can format that then how you like, but please note... I am currently in EEST Time-zone in-game but the SDK shows it in EET (an hour behind) - my in-game ETA says 18:24.
Can @RenCloud shine any light on the timezone the SDK spits out? Thanks!
Thanks for the help N95JPL. I'm not quite sure why i didn't added it as a Time/Frequency (datetime) object, but i guess it's because it's a float and in seconds.
Timezones... sadly the SDK doesn't provide information about them. Most features in game came later or until now never to the SDK,
For the GameTime
the documentation says Absolute in-game time.
So it doesn't matter where you are in-game and what settings in-game you have. I guess it was UTC or CET, but i'm not sure i have to check that.
No problem, glad to assist. The float does make sense once you realise its in Seconds, maybe that needs to be documented somewhere?
and ahh right okay - I assumed, because SCS uses CET on there posts alot that it will be that. Something to bare in mind when showing time. If you have Timezones turned on, you'll need to figure that out in your program!
Thanks @N95JPL . Thought NavigationTime is the time shown in the route advisor. Well I should have tried this before asking. My bad, but thanks for your help!