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

前端 未结 5 1229
难免孤独
难免孤独 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:25

    GetDateTimeFormats can parse DateTime to different formats. Example to "yyyy-MM-dd" format.

    SomeDate.Value.GetDateTimeFormats()[5]
    

    GetDateTimeFormats

提交回复
热议问题