after the app was released in azure, the date format is different

after the app was released in azure, the date format is different

tableFantableFan Posts: 10Questions: 7Answers: 0

Hi,
I developed an app in asp.net core mvc. In one of the views I have a editor datatable with a date field. The date field has the data type datetime in SQL. In localhost the date is as follows: dd / mm / yyyy. After I publish the app in azure, the date Fortmat changes to mm / dd / yyyy. But in the end I want it to be like in localhost, i.e. dd / mm / yyyy. Can someone help me please?

ajax: { url: "/Controller/Method" , type: "POST"}, table: "#editortable",

    fields: [

        {   
            label: "date1",
            name: "date1",
            type: "datetime",


        }, ... ]

I tried the editortable in the view with format: 'DD / MM / YYYY', but it didn't work

Answers

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    Sounds like the "culture" setting (in MS terms, in the Unix world "locale") is set to enUS on your Azure server. There must be a setting somewhere to have it change the default culture to enGB - although I'm afraid I don't know where that is in the Azure control panel.

    Even better would be to have the server always respond with ISO8601 and then use a client-side formatter to change it into the format your user wants, making your app location independent.

    Allan

Sign In or Register to comment.