Get local time that corresponds to a specified date and time value in CSharp
Description
The following code shows how to get local time that corresponds to a specified date and time value.
Example
using System;// ww w. ja v a2s . c o m
using System.Globalization;
class TimeZoneDemo
{
static void Main( )
{
TimeZone localZone = TimeZone.CurrentTimeZone;
Console.WriteLine(localZone.ToLocalTime(DateTime.Now) );
}
}
The code above generates the following result.