如何在VB中使用日期和时间? [英] How to use Date and Time in VB?

查看:277
本文介绍了如何在VB中使用日期和时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


1.如何在MDI表格上显示实时时钟(系统时钟)? (连续更新)


2.获取的系统日期以MM / DD / YYYY格式显示在文本框中。即使我将数据格式属性设置为DD-Month-YYYY。


可以有人帮助我。



-NE☼

Hi All,

1. How can I show live clock (system''s clock) on my MDI form? (Continuous updation)

2. Fetched System Date is being displayed in MM/DD/YYYY format in a text box. Even when I set data format property to DD-Month-YYYY.


can somebody help me.


-NE☼

推荐答案


1.如何在我的节目上显示实时时钟(系统的时钟) MDI表格? (连续更新)
1. How can I show live clock (system''s clock) on my MDI form? (Continuous updation)



我建议使用StatusBar控件,这可能是最简单的。否则,我想您可以使用计时器控件并将其写入标签标题或文本框。

I''d recommend using the StatusBar control, that''s probably the simplest. Otherwise, I suppose you could use a timer control and write it to a label caption or a textbox.


2.获取的系统日期以MM / DD /显示YYYY格式在文本框中。即使我将数据格式属性设置为DD-Month-YYYY。
2. Fetched System Date is being displayed in MM/DD/YYYY format in a text box. Even when I set data format property to DD-Month-YYYY.



什么是数据格式属性就是它? (我假设你的意思是dat e 格式,但仍然不知道你指的是什么。)

如果放置在文本框中,也许最简单的选择是首先使用 Format()函数来获取所需的字符串。理想情况下,您应该使用命名格式,例如General Date和General Date。允许Windows使用该PC上指定的格式。如果您使用自己的自定义格式,例如MM / DD / YYYY,然后你就强迫每个人。


P.S. "更新用" ;?嘿,我今天学到了一个新词。 :)

What "data format property" is that? (I assume you mean date format, but still don''t know exactly what you''re referring to.)
If placing in a textbox, perhaps the simplest option is to first use Format() function to get the string you want. Ideally, you should use the named formats such as "General Date" to allow Windows to use the format specified on that PC. If you use your own custom format such as "MM/DD/YYYY" then you are forcing that on everybody.

P.S. "Updation"? Hey, I''ve learned a new word today. :)


展开 | 选择 | Wrap | 行号


如果我们知道我们在说什么版本会有所帮助,以及。
It would help if we knew what version we''re talking about, as well.


这篇关于如何在VB中使用日期和时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆