开发者

Convert 6 digit number to time in asp.net

Is there a function in .net that will take a number such as 134,501 and con开发者_StackOverflow社区vert it to time? That time would be 1:45:01 pm. I was hoping i didn't have to reinvent the wheel for this.


Assuming you're using today's date:

int timeNumber = 134501;
DateTime time = DateTime.ParseExact(timeNumber.ToString().PadLeft(6, '0'), "HHmmss", null);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜