How to set Date and time format in IIS 7

前端 未结 9 1179
春和景丽
春和景丽 2020-12-02 18:31

I have date format in my local machine : (d/M/yyyy h:mm tt) ==> (23/6/2011 4:30 PM)

when i publish my website on IIS server it converts date format to (M/d/yyyy H:mm

9条回答
  •  情歌与酒
    2020-12-02 19:26

    This is based on Nedim answer, but with tweak:

    • Go to Control Panel
    • Click Region and you will see a screen with 3 tabs (Formats, Location and Administrative)
    • Click Formats and choose the settings you prefer
    • Click Additional settings
    • Click Date tab
    • Change Short date to desired format and confirm dialog
    • Click Location and choose the settings you prefer
    • Click Administrative tab. For "Welcome screen and new user accounts", click copy settings. From the new window, click both checkboxes for 'welcome screen and system accounts' and 'new user accounts' (if you skip this step, you will still see the issue because IIS uses system account)
    • Approve all changes for Region by clicking Ok on all open windows
    • Open Command prompt, write iisreset and enter
    • If you still don't see the changes try logoff and logon

    In my case the default format for my country was wrong and I couldn't pick proper format except choosing someting else with desired format. But there was web.config with globalization set to my local culture which had precedense.

提交回复
热议问题