日期格式 [英] date formats

查看:66
本文介绍了日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在vb.net中,我想让用户在文本框中输入日期格式。

例如:mm / dd / yyyy
dd / mm / yyyy

dd-mm-yyyy


然后,如何检查这是一种有效的日期格式,怎么能我建立

一个例子,以便它显示在另一个文本框中?


12/31/2005


问候

解决方案




看看datetime解析和parseexact方法

http://msdn.microsoft.com/library/de...parsetopic.asp

http://msdn.microsoft.com/library/de ... exacttopic.asp


Ken

-------------------------

" Sam" < SA ************** @ voila.fr>在消息中写道

新闻:11 ********************** @ z14g2000cwz.googlegr oups.com ...



在vb.net中,我想让用户在文本框中输入日期格式。

例如:mm / dd / yyyy

dd / mm / yyyy

dd-mm-yyyy


然后,如何检查这是一种有效的日期格式以及如何我可以建立

一个例子,以便它显示在另一个文本框中吗?


12/31/2005


问候


谢谢,但它并不是我想要的。

我想再次检查用户输入的字符串(例如

DD / MM / yyyy)是一种有效的日期格式,然后通过显示

示例(2005年12月14日)来证明它


Sam,


通常IsDate功能应该足够


Cor

Hi,
In vb.net, I want to let the user enter a date format in a textbox.
e.g : mm/dd/yyyy
dd/mm/yyyy
dd-mm-yyyy

Then, how can I check this is a valid date format and how can I build
an example so that it is displayed in another textbox ?

12/31/2005

Regards

解决方案

Hi,

Take a look at the datetime parse and parseexact methods

http://msdn.microsoft.com/library/de...parsetopic.asp

http://msdn.microsoft.com/library/de...exacttopic.asp

Ken
-------------------------
"Sam" <sa**************@voila.fr> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi,
In vb.net, I want to let the user enter a date format in a textbox.
e.g : mm/dd/yyyy
dd/mm/yyyy
dd-mm-yyyy

Then, how can I check this is a valid date format and how can I build
an example so that it is displayed in another textbox ?

12/31/2005

Regards


Thanks but it''s not exactely what I want.
Again I want to check that the string entered by the user (e.g
DD/MM/yyyy) is a valid date format and then prove it by displaying an
example (14/12/2005)


Sam,

Normally should the IsDate function be enough

Cor


这篇关于日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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