0

I have a asp.net application 4.6.1 and the date that is displayed in my textbox is mm/dd/yyyy but I want dd-mm-yyyy so I am trying to change the global settings to change the date time format but with no success. I would like the project format to be fr-FR if possible.

I tried How do you globally set the date format in ASP.NET? and I tried to add globalization in web.config

<globalization  culture="fr-FR"  uiCulture="fr-FR"/>

But none of the solution worked for me

Here is my code so far.

</div>
 <div class="col-md-4 mb-3">
  <label for="validationCreationDate">Fecha creacion</label>
<asp:TextBox ID="txtCreationDate" type="Date" runat="server" class="form-control" placeholder="fecha creacion"  aria-describedby="inputGroupPrepend" required="required"></asp:TextBox>
  <div class="invalid-feedback">
    Please provide a valid place of birth.
  </div>

To conclude I would like the mm/dd/yyyy format to be dd-mm-yyyy. Thank you.

J.C
  • 632
  • 1
  • 10
  • 41
  • 1
    Maybe this will help? https://stackoverflow.com/questions/42451770/input-type-date-not-working-in-certain-browsers – aggaton Jan 22 '19 at 21:51
  • It doesn't help me because I want the user to be able to pick a date from the asp.net calendar and I want the date to be changed dynamically to the for the format dd-mm-yyyy or yyyy-mm-dd. – J.C Jan 22 '19 at 22:14
  • 1
    This? https://documentation.devexpress.com/AspNet/12062/Localization/How-to-Set-a-Culture-for-an-ASP-NET-Web-Page – aggaton Jan 22 '19 at 22:18
  • I have already tried the method suggested in the Declarative approaches which is suggested in the web page but it doesn't work for me for some reason. – J.C Jan 22 '19 at 22:23
  • 1
    These are the methods you generally use in order to globalize and also localize data in asp.net. I seem vaguely to recall you need to change the localized setting on the entire computer, not just the browser for this to work. – aggaton Jan 22 '19 at 22:31
  • Thank you thank you, now I understand who it works. – J.C Jan 22 '19 at 22:36

0 Answers0