WinForm的dateTimePicker如何精确到毫秒

webhermit 2009-11-11 02:34:23
如题,我设置了yyyy-MM-dd HH:mm:ss:fff,显示的结果是2009-11-11 14:26:fff,请问如何才能精确到毫秒,在线等,立马结贴!
...全文
1278 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
zgke 2009-11-11
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 webhermit 的回复:]
要赋值给dateTimePicker才行,这个赋值报错!
[/Quote]
看错了 最后放一个NumericUpDown把
lsj_zrp 2009-11-11
  • 打赏
  • 举报
回复
直接在dataTimePicker里面应该显示不出来
hhc123 2009-11-11
  • 打赏
  • 举报
回复
神七发射倒计时,也才用秒

webhermit 2009-11-11
  • 打赏
  • 举报
回复
或者Winform里面有没有什么控件或者方法能实现如下格式:
--:--:--:--:--:--:---:
zhujiazhi 2009-11-11
  • 打赏
  • 举报
回复
DateTime time = dateTimePicker1.Value;
string xx = time.ToString("MM/dd/yyyy hh:mm:ss.fff");
这样可以显示的了
qlzf11140820 2009-11-11
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 zhoukang0916 的回复:]
就算行也没这个必要!


[/Quote]up
webhermit 2009-11-11
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 zgke 的回复:]
this.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff");
[/Quote]
要赋值给dateTimePicker才行,这个赋值报错!
宝_爸 2009-11-11
  • 打赏
  • 举报
回复
AFAIK the answer is no. The supported formats are described in the MSDN docmentation for the CustomFormat property. You can't use it for anything more precise than a second.

This control wraps the native Windows DateTimePicker control implemented in ComCtl32.dll and only supports format strings supported by that control - the .NET "f" specifier for fractions of a second is not supported.


来自:
http://social.msdn.microsoft.com/Forums/en-US/csharplanguage/thread/9c3f9006-dae7-47d8-b736-b0f076995adf
hhc123 2009-11-11
  • 打赏
  • 举报
回复
等为火箭专家来
zgke 2009-11-11
  • 打赏
  • 举报
回复
this.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff");
PandaIT 2009-11-11
  • 打赏
  • 举报
回复
就算行也没这个必要!

111,119

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧