vb.net 在标签 1 中显示时间并在标签 2 中显示日期
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21037501/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 16:24:40 来源:igfitidea点击:
Display Time in Label 1 and Display Date in Label 2
提问by Dreamer XD
How can I Display time in military clock format to label 1 and Display date in Longdate format to label 2 regards guys.
我如何以军用时钟格式显示时间以标记 1 并以 Longdate 格式显示日期以标记 2 问候伙计们。
Label6.Text = DateTime.Now.ToLongDateString()
Label3.Text = Now.ToLongTimeString.ToString()
回答by HomeGrownCoder
Try the following:
请尝试以下操作:
Me.Label1.Text = DateTime.Now.ToString("HH:mm:ss")
Me.Label2.Text = DateTime.Now.ToLongDateString

