I want to format the input string into MM/dd/yyyy hh:mm:ss format in C#. The input string is in format MM/dd/yyyy hh:mm:ss For example :
MM/dd/yyyy hh:mm:ss
You may use this type format (get formatted data from sql server)
FORMAT(convert(datetime,'16/04/2018 10:52:20',103),'dd/MM/yyyy HH:mm:ss', 'en-us')
CONVERT(VARCHAR,convert(datetime,'16/04/2018 10:52:20',103), 120)