Date conversion from C# to MySql Format

后端 未结 4 828
闹比i
闹比i 2020-12-17 04:27

How to convert C# datetime to MySql Datetime format. I am getting value from text box like 7/27/2011 this format. But i want to convert in this format 2011-7-27. So here i a

4条回答
  •  自闭症患者
    2020-12-17 05:29

    Assuming you are doing this in the database I think you should use date_format to get in the required format

    Something like date_format(dateval,'%Y-%c-%d') (Not tested)

提交回复
热议问题