-1

I am creating a web app in which I am fetching a date from textbox into the webservice

current date format of my date is like this 10-October-2016 but I want to convert it into 10-10-2016

I want to convert it in webservice itself

can anyone help me out

Mostafiz
  • 7,243
  • 3
  • 28
  • 42

1 Answers1

2

You can convert using DateTime.ParseExact

string dt = "10-October-2016";
string date = DateTime.ParseExact(dt, "dd-MMMM-yyyy", CultureInfo.InvariantCulture).ToString("dd-MM-yyyy");
Mostafiz
  • 7,243
  • 3
  • 28
  • 42