' The local time is equal to the Coordinated Universal Time (UTC) time plus the UTC offset. For more information about the UTC offset, see TimeZone. The conversion also takes into account the daylight saving time rule that applies to the time represented by the current DateTime object.'
Re: C# Get Datetime Now UTC
Apr 08, 2015 07:37 PMgerrylowryLINK
Unfortunately, the DateTime class doesn't have the convenience methods available in the Time class to do this. You can convert any DateTime object into UTC like this: d = DateTime.now d.newoffset(Rational(0, 24)) You can switch back from UTC to localtime using: d.newoffset(DateTime.now.offset) where d is a DateTime object in UTC time. If you'd like these as. Coordinated Universal Time or UTC is a standard, not a time zone. In other words, it is the base point for all other time zones in the world. They are determined by their difference to UTC. UTC is represented as UTC +0. Coordinated Universal Time is a 24-hour time standard that is used to synchronize world clocks.
This is more complicated than adding one hour to UTC.
The solution at http://forums.asp.net/post/5891004.aspx will not work during part of the year because Poland follows DST and Vietnam does not according to http://en.wikipedia.org/wiki/Daylight_saving_time_by_country . Otherwise you could use an offset from Vietnam time iff both countries start and end DST at the same calendar date and time.
of course, the best solution, not happening any time soon, would be in the entire world stopped using Daylight Saving Time.
Current Utc Date And Time
Currently, Poland is UTC+2.
|Poland||Europe||Boreal/North||01:00 UTC on last Sunday March||01:00 UTC on last Sunday October||Observed DST in 1916-1919, 1940-1949, 1957-1964 and since 1977.|
|Vietnam||Asia||-||-||-||Does not use DST|
study this link: https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspx
Another issue .. you're in Poland (?) so the time will be wrong for an end user in most other countries, for example, see http://en.wikipedia.org/wiki/Time_zone .
see https://msdn.microsoft.com/en-us/goglobal/bb688125.aspx 'Globalization Step by Step' Office chair aeron.
Current Utc Day Date Time
and https://msdn.microsoft.com/en-us/goglobal/bb688121 'Use Locale Model'
see also https://msdn.microsoft.com/en-us/library/system.timezoneinfo(v=vs.110).aspx 'TimeZoneInfo Class'
one facet of the problems in time conversion is that local time is the local time of the web server.
https://msdn.microsoft.com/en-us/library/system.datetime.tolocaltime(v=vs.110).aspx 'DateTime.ToLocalTime Method'
Utc Date And Time Format
'Converts the value of the current DateTime object to local time.'
'The local time is equal to the Coordinated Universal Time (UTC) time plus the UTC offset.
For more information about the UTC offset, see TimeZone.GetUtcOffset.
The conversion also takes into account the daylight saving time rule that applies to the time represented by the current DateTime object.'
SIMPLE but imperfect solution (because maintenance may be required if Poland changes when it starts and/or ends UTC):
using UTC time, determine if Poland should be using Standard Time or Daylight Saving Time: