开发者

MVC DateTime in Editorfor Template - date format is wrong

I have an EditorFor Template to format the date within my Text boxes:

<%@ Control Language="C#" Inherits="System.Web.Mv开发者_Go百科c.ViewUserControl<System.DateTime?>" %>
<%= Html.TextBox("", (Model.HasValue ? Model.Value.ToString("dd/MM/yyyy") : string.Empty)) %>

Trouble is that its rendering in the US format of MM/dd/yyyy

This is only happening on my production server and not my development machine. This is the first time I've seen this issue on my production server as all my other sites have UK formatting.

Any ideas?


Add a globalization setting in web.config:

<globalization uiCulture="en-GB" culture="en-GB" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜