[Solved] Convert string date to another format C#? [closed]
Use DateTime.ParseExact: public string dateBirthday(string date) { DateTime a = DateTime.ParseExact(date, “dd.MM.yyyy”, CultureInfo.InvariantCulture); //return a.ToString(“dd/MM/yyyy”); // original answer without culture return a.ToString(“dd/MM/yyyy”, CultureInfo.InvariantCulture); } EDIT: As Jon Skeet already said, the / is culture-dependent and we (you and me;)) did not specify a culture for the ToString() function, so the culture of the host environment … Read more