change of time zone when calculating the duration of the flight from origin city to destination city - asp.net-2.0

i am working on a Airlline reservation system.I came with a query in which i want to display the duration of flight from origin city to destination city, both are in different time zones. How can i handle this problem.
SIJO A J

Convert both times to UTC and see how long the flight takes.

Related

School Zone Alerts Speed Zone Not Changing / Are the Alerts School Hours Sensitive

The speed zone Here.com SDK I am using to best of my knowledge has school zone data included however when ever I driver through a school zone during school hours (as I am of the view the school zone speed zone is time sensitive) It does not change the speed zone as I expect it would.
Also looking at the SDK schoolZoneSpeedLimitInMetersPerSecond.
It does not make any reference to the zones being time of day and day sensitive.
Does that mean that the school zone alerts operate 24/7 if driving through a school zone even though the school is closed eg outside of school hours and on weekends and school holidays.
The speed limit values for school zones provided by the HERE SDK are sometimes valid based on the current device-time. They are not always time-dependent, and they are notified with the information that is visible on the local road sign.
In your case it seems you see the road sign, but you get no notification. In that case, there may be a data issue and it may be worth to share such places with the HERE team.
Or - it can be that the school zone sign is time-dependent and your device is set to a time outside of that valid time range. Then the notficiation is not forwarded. I am not sure about Waze, but it can be the case that they always forward the limit - even when it is currently not valid, as it's outside the time range.

here-api Time taken to travel the distance

I was trying the HERE routing maps to find out if it actually give me reasonable time for the distances that I already know.
Source : 12.971076,77.537375
Destination: 12.975366,77.606841
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?waypoint0=12.971076,77.537375&waypoint1=12.975366,77.606841&mode=fastest%3Bcar%3Btraffic%3Aenabled&departure=now&apiKey={API-Key}
I see that the API always gives me the time taken in between 33/34 minutes on all days of the week and all hours of the day.
Any idea on how the travel time is calculated?
In my opinion, for the above coordinates, during the rush hours it takes anywhere between 50-80 minutes.
We have replicated the same API, and got 2 different travel time by altering the value of departure. Can you please try to use below DEPARTURE time format.
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?waypoint0=12.971076,77.537375&waypoint1=12.975366,77.606841&mode=fastest%3Bcar%3Btraffic%3Aenabled&departure=2020-03-19T13:00:00&apiKey=xxxxxx
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?waypoint0=12.971076,77.537375&waypoint1=12.975366,77.606841&mode=fastest%3Bcar%3Btraffic%3Aenabled&departure=2020-03-19T10:00:00&apiKey=xxxxxx

Get routes with historical LIVE data

I would like to retrieve historical travel times from HERE API.
Following the API documentation for 'Calculate Route', I requested travel times for a fixed route at a fixed departure time for different days in the past, using mode=fastest;car;traffic:enabled.
The result is the same route every day and a weekday pattern (i.e., same travel time each Monday) for travel times. This obviously does not include actual traffic conditions on the specified day.
From the documentation, I would have expected to get specific travel times for each day in the past (up to one year).
Did I miss something or is this just not possible?
Thanks a lot for any help!
It is not possible to get the exact route for a past date. For any date other than NOW(current time), the route is calculated with the accumulated historical data taking into consideration the week day, time of the day, any construction work etc.

Taking care of daylight saving time when converting timezone

I have a Redshift data table where all time values are stored in CST and I convert the time values to the respective timezone based on the zip code (location).
While I do that, I understand that all time values are in Standard time and hence my function usage is
CASE WHEN **** convert_timezone('CST', 'EST', time_column)
WHEN **** convert_timezone('CST', 'MST', time_column)
....
END
This may not be applicable once we enter into Daylight Savings time. How can I take care of this such that I do not modify the SQL query again in 2018 March and in future?
Don't use time zone abbreviations. The are somewhat ambiguous, and can only refer to one aspect of the time zone. Instead, use a full IANA time zone identifier, such as America/Chicago for US Central time.
This is explained well in the Redshift docs:
Using a Time Zone Name
If you specify a time zone using a time zone name, CONVERT_TIMEZONE automatically adjusts for Daylight Saving Time (DST), or any other local seasonal protocol, such as Summer Time, Standard Time, or Winter Time, that is in force for that time zone during the date and time specified by 'timestamp'. For example, 'Europe/London' represents UTC in the winter and UTC+1 in the summer.
As far as the "...based on the zip code" part of your question, understand that not every ZIP code is locality-based. There are also technical assignments, overseas APO/FPO addresses, US territories, and other edge cases. Additionally, some zip codes may straddle more than one time zone.
A better approach, when possible, is to:
Get an approximation of latitude/longitude coordinates - using a variety of techniques depending on your source data. For example, geocoding APIs can take a street address and give a lat/lon.
Then determine the time zone identifier for that location, using one of the techniques listed here.

Server DateTime issue -> client get bad experience

If server is located in US and website user is from Asia, when user add a new comment, he sees that the comment is added 10 hours ago because there is 10 hours timing difference in Asia and US.
What I want to do is when displaying comment, automatically convert date time to the time of target country or region where user come from.
Track user region/country
DateTime in any webpage should be converted to that country time
So that I can display user that he posted comment a few second ago...
Handle all dates internally as UTC,
meaning 0 hour offset
Use the language/country part of the user-agent string or the ip address to detect where the user is from, and look up the timezone.
Use TimeZoneInfo.ConvertTime(..) to convert the UAC time to the users local time
Point 2 will be the most work unless you find some lookup table or existing code to do this.

Resources