开发者

how can i get milliseconds with a date

开发者 https://www.devze.com 2022-12-26 03:40 出处:网络
i am trying this Datetime t=Convert.ToDateTime(row[\"TimeStamp\"]) i am getting this record f开发者_如何学Pythonrom Database dat contains the milliseconds too

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

精彩评论

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