Converting time to Military

后端 未结 6 1260
清歌不尽
清歌不尽 2021-01-11 12:40

In an attempt to turn a date with a format of \"mm/dd/yyyy hh:mm:ss PM\" into military time, the following replacement of a row value does not seem to take. Eve

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-11 13:22

    Instead of formatting the string manually, you should use:

    oos.ToString("M/d/yyyy HH:mm");
    

    Also, what do you mean by "would not accept a value"? Are you getting an exception? If so, what is the error message?

提交回复
热议问题