Convert DateTime in C# to yyyy-MM-dd format and Store it to MySql DateTime Field

前端 未结 5 1230
难免孤独
难免孤独 2021-02-01 12:49

I am trying to convert DateTime format to yyyy-MM-dd format and store it to DateTime object. But it gives me the System DateTime

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 13:34

    We can use the below its very simple.

    Date.ToString("yyyy-MM-dd");
    

提交回复
热议问题