CSharp examples for System:DateTime Timezone
To Pacific Time
using System.Threading.Tasks; using System.Text; using System.Linq; using System.Collections.Generic; using System;/*w w w . ja v a2 s .c o m*/ public class Main{ public static DateTime ToPacificTime(this DateTime dateTime) { return TimeZoneInfo.ConvertTimeFromUtc(dateTime, Pacific); } public static DateTime? ToPacificTime(this DateTime? dateTime) { if (dateTime == null) { return null; } return ToPacificTime(dateTime.Value); } }