Sunday, 18 May 2014

Best convert code string to datetime and To convert the string you parse it into a DateTime value, the format that into a string

using System.Globalization;
string date = "20100102";
   DateTime datetime = DateTime.ParseExact(date, "yyyyMMdd", CultureInfo.InvariantCulture);

string newFormat = DateTime.ParseExact(theDate, "dd'.'MM'.'yyyy", CultureInfo.InvariantCulture).ToString("yyyy'/'MM'/'dd")

No comments:

Post a Comment