how to convert 24-hour format TimeSpan to 12-hour format TimeSpan?

前端 未结 8 928
陌清茗
陌清茗 2021-01-04 05:17

I have TimeSpan data represented as 24-hour format, such as 14:00:00, I wanna convert it to 12-hour format, 2:00 PM, I googled and found something related in stackoverflow a

8条回答
  •  囚心锁ツ
    2021-01-04 05:34

    TimeSpan represents a time interval not a time of day. The DateTime structure is more likely what you're looking for.

提交回复
热议问题