sanu
sanu

Reputation: 33

How to convert dd-mm-yyyy to dd/mm/yyyy in asp.net?

convert dd-mm-yyyy to dd/mm/yyyy for inserting into oracle using oracle client in asp.net

string oldstr = TextBox1.Text;
string strDate = DateTime.ParseExact(oldstr, "dd-MM-yyyy", null).ToString("dd/MM/yyyy");
TextBox4.Text = strDate;

Upvotes: 2

Views: 5611

Answers (1)

Ajay
Ajay

Reputation: 6590

for c#

DateTime.ParseExact(input, "dd-MM-yyyy", CultureInfo.InvarientCulture).ToString("dd/MM/yyyy")

Upvotes: 1

Related Questions