Jean Paul's Blog

There are 2 types of People in the World, One who Likes SharePoint and..

    Advertisements
  • Microsoft MVP

  • MindCracker MVP

  • CodeProject MVP

  • eBook on SharePoint 2010

  • eBook on Design Patterns

  • eBook on Windows Azure

  • NLayers Framework @ CodePlex

  • MSDN Forums

  • .Net vs. Java

    Due to Public Demand
  • Advertisements

Archive for February, 2011

Lambda Expression for converting current datetime to Indian Standard Time / Eastern Standard Time (USA & Canada)

Posted by Paul on February 2, 2011

DateTime newTime = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.GetSystemTimeZones().Where(t => t.StandardName.Contains("India Standard Time")).First().Id));

 

DateTime newTime = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.FindSystemTimeZoneById(TimeZoneInfo.GetSystemTimeZones().Where(t => t.StandardName.Contains("Eastern Standard Time")).First().Id));

Advertisements

Posted in C# | Tagged: , | Leave a Comment »