Converts the current date and time to Coordinated Universal Time (UTC).
using System;
public class Example
{
public static void Main()
{
DateTime datNowLocal = DateTime.Now;
Console.WriteLine("Converting {0}, Kind {1}:", datNowLocal, datNowLocal.Kind);
Console.WriteLine(" ConvertTimeToUtc: {0}, Kind {1}", TimeZoneInfo.ConvertTimeToUtc(datNowLocal), TimeZoneInfo.ConvertTimeToUtc(datNowLocal).Kind);
}
}
Related examples in the same category