在文本框中显示完整日期 [英] Viweing full date in the text-box

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

问题描述

我使用日历控制器将日期插入到ASP.Net中使用的表单之一.但是文本框将日期显示为短日期.我只想将日期显示为长日期以便更好地查看.

我将VB 2005与ASP.Net 2.0一起使用.

I used a calender controller to insert a date to one of my forms used in ASP.Net. But the text-box shows the date as a short date. All I want is to display the date as a long date for better viewing.

I used VB 2005 with ASP.Net 2.0

推荐答案

使用ToString函数设置日期格式,并使用Long Date格式字符串:"F"
Format the date with the ToString function, with the Long Date format string: "F"
Console.WriteLine(dt.ToString("F"))

此处有格式代码列表:格式化要显示的DateTime-格式化字符串描述 [ ^ ]

There is a list of the format codes here: Formatting a DateTime for display - format string description[^]


这篇关于在文本框中显示完整日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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