开发者

how can i get milliseconds with a date

i am trying this

Datetime t=Convert.ToDateTime(row["TimeStamp"])

i am getting this record f开发者_如何学Pythonrom Database dat contains the milliseconds too but when i do this i lose the milliseconds how can i get the milliseconds


From this MSDN article on ToDateTime it looks like either a string or an object is being passed in. Either way, the method returns a DateTime object, which has properties Millisecond, Second etc. So, I suggest you try:

t.Millisecond

If its value is 0 then check that there are milliseconds in the original string, not just seconds.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜