Whenever i display this data using data table, it displays column “DOJ” with its date component and time component, However, i want to display only date component in dd/MM/yyyy format, How can i achieve this without using split() method.?
Give a try to this
For Each row As datarow In dt_input.Rows
row(“DOJ”)= Date.ParseExact(row(“DOJ”).ToString,“MM/dd/yyyy 00:00:00”,system.Globalization.CultureInfo.InvariantCulture).ToString(“MM/dd/yyyy”)
Next
While reading the DOJ column, the format is getting converted into System.DateTime, so you can convert it into your desired format by using the following function: