Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to set date Format as dd-mm-yyyy. #3570


User avatar
0
velu created

Hi,

How to set date Format as dd-mm-yyyy in application. We are using ASP.NET MVC 5.x & Angularjs 1.x.

Please confirm us what to do.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @velu,

    Do you want to use this format in entire app and don't allow users to change it ? If so, you can set it here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/dev/src/MyCompanyName.AbpZeroTemplate.Web/Global.asax.cs#L62">https://github.com/aspnetzero/aspnet-ze ... sax.cs#L62</a> in your project.

    CultureInfo culture = (CultureInfo)CultureInfo.CurrentCulture.Clone();
    culture.DateTimeFormat.ShortDatePattern = "dd-MMM-yyyy";
    culture.DateTimeFormat.LongTimePattern = "";
    Thread.CurrentThread.CurrentCulture = culture;