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?
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
, - , .
, , , , . TimeZoneInfo: Noda , . (, .)
TimeZoneInfo
TimeZoneInfo ( Noda Time ITimeZone), , DateTime DateTimeOffset ( ZonedDateTime ). , .
ITimeZone
DateTime
DateTimeOffset
ZonedDateTime
EDIT: SO, , Geonames . , - Windows, - . ( , Noda, AFAIK.)
, - . . , 11 , , . , . , , .
, , GMT, , - .
, DST , , . , . : 2000 NSW, , DST, .
Source: https://habr.com/ru/post/1753643/More articles:ImageMagik / UNIX: How to recursively process a nested photo directory? - unixLogging Enterprise Library 4.1 does not write errors to the receiver when a file is unavailable - .netGood / simple shopping cart example using asp.net mvc and jquery - jqueryОтслеживание типов данных в Python - pythonБиблиотеки для стандартных материалов (то есть: cout и т.д.) * ВОПРОСЫ NEWBIE *:) - c++location of firefox source code that parses the Set-Cookie header? - javaWhat is a free SQL Server Management Studio on Mac - sql-serverF # Friend Function / Class - oopGet current value OverlayItem - androidmonitoring / capturing real-time usage statistics? - .netAll Articles