如何在vb.net中仅使用AM或PM获取当前时间 [英] How to get current time only with AM or PM in vb.net
本文介绍了如何在vb.net中仅使用AM或PM获取当前时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hai all
如何在vb.net.i.e中仅获得AM或PM的时间。上午11:00或下午08:35
或者也可以使用ms,如上午11:00:35或08:35:40
请回复asap
问候
Aravind
Hai all
How to get time only with AM or PM in vb.net.i.e. 11:00 AM or 08:35 PM
or can get with ms also like 11:00:35 AM or 08:35:40 PM
pls reply asap
Regards
Aravind
推荐答案
试试这个:
lbltime.Text = System.DateTime.Now.ToShortDateString()
Dim d1 As String = DateTime.Parse(lbltime.Text).ToString(dd / MM / yyyy hh:mm:ss tt)
Try This:
lbltime.Text = System.DateTime.Now.ToShortDateString()
Dim d1 As String = DateTime.Parse(lbltime.Text).ToString("dd/MM/yyyy hh:mm:ss tt")
textbox1.text = format(现在,hh:mm :ss tt)希望它适合你
textbox1.text = format(now, "hh:mm:ss tt") hope it works for you
这篇关于如何在vb.net中仅使用AM或PM获取当前时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文