日期选择器以dd MMMM yyyy格式返回日期 [英] date picker to return date in dd MMMM yyyy format

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

问题描述

亲爱的专家,





表格上带有日期日历分机的文本框。



选择日期 返回日期应该在表格中说



2014年12月16日





表格上的日期是:: txt_Date_Disb.Text





日历中的返回日期如何(即代码)?



谢谢

解决方案

日历控件将日期作为DateTime值返回,然后您可以以任何方式格式化你想要的。



您可以使用DateTime对象的ToString(dd MMM yyyy)方法来获取您要求的格式。


< blockquote>在calander扩展器中有属性Format为文本框指定一个特定的日期尝试...格式=dd-MMMM-YY;



 <   asp:CalendarExtender     ID   =   txt_date_CalendarExtender    runat   =  server  

已启用 = True TargetControlID = txt_date 格式 = yyyy-MM-dd >
< / asp:CalendarExtender >



显示日期如2014-12-05


Dear expert,


A Text box on a form with a Date calendar Extension.

On Selecting the date the return date should be in the form say

16 Dec 2014.


The date on the form is:: txt_Date_Disb.Text


How is the return date from the calendar like (i.e. the codes) ?

Thanks

解决方案

Calendar control returns date as a DateTime value which you can then format in any way you want.

You can use DateTime object's ToString("dd MMM yyyy") method to get the format you asked for.


in the calander extender have property Format to assign a specific foramted date to textbox try it... Format="dd-MMMM-YY";

<asp:CalendarExtender ID="txt_date_CalendarExtender" runat="server"

            Enabled="True" TargetControlID="txt_date" Format="yyyy-MM-dd">
        </asp:CalendarExtender>


it show date like 2014-12-05


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

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