如何在文本框中的MVC3中转换日期格式(dd/MM/yyyy) [英] How to convert date format(dd/MM/yyyy) in MVC3 in textbox
本文介绍了如何在文本框中的MVC3中转换日期格式(dd/MM/yyyy)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
如何在文本框中的MVC3中转换日期格式(dd/MM/yyyy)
我的代码如下
Hi all,
How to convert date format(dd/MM/yyyy) in MVC3 in textbox
My code is as follows
@Html.EditorFor(model => Model.created_date)
谢谢,
Sampath bejugama.
Thanks,
Sampath bejugama .
推荐答案
Model.created_date.ToShortDateString()
http://msdn.microsoft.com/en-us/library/system.datetime. toshortdatestring.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/system.datetime.toshortdatestring.aspx[^]
您是否尝试过:
Hi,
Have you tried this:
@Html.TextBoxFor(mode => model.created_date.ToString("dd/MM/yyyy")
这篇关于如何在文本框中的MVC3中转换日期格式(dd/MM/yyyy)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文