Google apps
Main menu

Post a Comment On: Blogpad

"Time Zones Pacific UTC"

1 Comment -

1 – 1 of 1
Blogger fc said...

Generic methods

public const string MOUNTAIN_TIMEZONE_ID = "Mountain Standard Time";
public const string PACIFIC_TIMEZONE_ID = "Pacific Standard Time";

public static DateTime ToUtc(DateTime sourceDateTime, string sourceTimezoneID) {
TimeZoneInfo originalTimeZone = TimeZoneInfo.FindSystemTimeZoneById(sourceTimezoneID);
return TimeZoneInfo.ConvertTimeToUtc(sourceDateTime, originalTimeZone);
}

public static DateTime FromUtc(DateTime utcDateTime, string destinationTimezoneID) {
TimeZoneInfo originalTimeZone = TimeZoneInfo.FindSystemTimeZoneById(destinationTimezoneID);
return TimeZoneInfo.ConvertTimeFromUtc(utcDateTime, originalTimeZone);
}

April 27, 2012 at 4:59 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot