Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hii ,

I am trying to change datetime format to dd/MM/yyyy but its giving me mm/dd/yyyy and even on save this format its not accepting ..

I tried to chnage globalization setting from web.config as well

set it to en-gb

Below is my code

C#
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}", ApplyFormatInEditMode = true)]
      public DateTime? HireDate { get; set; }


My Editor Template

@model DateTime?

@Html.TextBox("", Model.HasValue ? @ViewData.TemplateInfo.FormattedModelValue : "", new { @class = "date" })


My Script

XML
<script>
    $(document).ready(function () {
        $("input:text.date").datepicker({ dateformat: "dd/MM/yyyy" });
    });
</script>



Please suggest on this ,

Thanks
Posted
Updated 27-Feb-15 17:50pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900