How can I convert a date in the following format to a date in the India time zone (UTC+5:30) using C#?
2012-09-13T05:08:03.151Z
How can I convert a date in the following format to a date in the India time zone (UTC+5:30) using C#?
2012-09-13T05:08:03.151Z
How about
DateTime dt = DateTime.ParseExact("2012-09-13T05:08:03.151Z",
"yyyy-MM-dd HH:mm:ssK",
CultureInfo.InvariantCulture)
Then
var indianTime = TimeZoneInfo.ConvertTime (dt,
TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"));
Try this:
DateTime dt = DateTime.ParseExact("your current date string","your current date string format",null);
string IndianDT = dt.ToString("dd/MM/yyy");
Now in your IndianDT string you will have your Date desired format.
Edit:
In my above code:
replace "your current date string fromat" with "yyyy-MM-ddThh:mm:ss.fffZ"