Future Local time of a place using longitude and longitude

I am developing a travel application.

for this I need to calculate the future local time and location time using Datetime (future date), longitude and latitude. (for example: I want to calculate the local time and location date on August 10, 2010, 11.23 a.m. Due to day time saving time, the date and time offset may change, so I need to convert August-10-2010 11.23 AM to local location time) I have There are longitude, latitude and input time. I can calculate the current local date using longitude and latitude, but I can’t accurately calculate for ** the future date because the daylight time is set **. may be changed in future dates.

I am using asp.net and c #.

Can anyone help?

+3
source share
3 answers

Here's a Microsoft article on best practices for DateTime in .NET that covers daylight-saving localization.

In short, make sure you use universal times and GMT offsets.

DateTime.ToUniversalTime()

The method converts any existing DateTime object to the UTC version. Remember that UTC shifts work on the basis of longitude - the primary meridian is the longitude of zero, so GMT GMT = 0. For California, your GMT offset will be minus 800.

In addition, you can always get the localization of the browser and also determine the time zone:

http://madskristensen.net/post/Get-language-and-country-from-a-browser-in-ASPNET.aspx

+1
source

, - , .

  • DST , , .
  • ( ) , .

, , , , . TimeZoneInfo: Noda , . (, .)

TimeZoneInfo ( Noda Time ITimeZone), , DateTime DateTimeOffset ( ZonedDateTime ). , .

EDIT: SO, , Geonames . , - Windows, - . ( , Noda, AFAIK.)

, - . . , 11 , , . , . , , .

+1

, , GMT, , - .

  • Lat, Long, , (Locale)
  • , , GMT, DST ( , #, , ).
  • GMT ​​ DST Locale, , .

, DST , , . , . : 2000 NSW, , DST, .

0

Source: https://habr.com/ru/post/1753643/


All Articles