Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class HtmlHelpers
- {
- private static DateTime ConvertToLocalTime(DateTime utcDate)
- {
- var localTimeZoneId = "W. Europe Standard Time";
- var localTimeZone = TimeZoneInfo.FindSystemTimeZoneById(localTimeZoneId);
- var localTime = TimeZoneInfo.ConvertTimeFromUtc(utcDate, localTimeZone);
- return localTime;
- }
- public static string ToLocalTime(DateTime date)
- {
- return ConvertToLocalTime(date).ToString("dd MMMM yyyy");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement