bujjibabu bujjibabu - 2 years ago 79
SQL Question

convert date from 22/06/2016 1:54 pm to 2016-06-22 1:54 pm format

convert 22/06/2016 1:54 pm to 2016-06-22 1:54 pm format

Eli Eli
Answer Source

You can also use ParseExact:

var result =
    DateTime.ParseExact("22/06/2016 1:54 pm", "dd/MM/yyyy h:mm tt", CultureInfo.InvariantCulture)
        .ToString("yyyy-MM-dd h:mm tt");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download