KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My system date format is dd-MM-yyyy(20-10-2012) and I'm getting the date and using separator to split the date, month and year. I need to convert date format (dd/MM/yyyy) whether the formats returns at any date format. string sDate = string.Empty; DateTime _date = DateTime.Now; int count = 0; string format = "dd-MM-yyyy"; sDate = dateFormat.ToString(format); string[] Words = sDate.Split(new char[] { '-' }); foreach (string Word in Words) { count += 1; if (count == 1) { Day = Word; } if (count == 2) { Month = Word; } if (count == 3) { Year = Word; } }
Tags (comma-separated)
Save Edits
Cancel