How to set Date and time format in IIS 7

前端 未结 9 1146
春和景丽
春和景丽 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.

    0 讨论(0)
  • 2020-12-02 19:34
    1. Change your system short date and log date format as desired.
    2. Check app pool of your application in IIS.
    3. Go to Application pools section of IIS and change Identity of that pool to local system(because your desired date format you have set is in your local system)
    4. Restart your app in IIS
    0 讨论(0)
  • 2020-12-02 19:35

    If you have changed you system date format and Clicked on Copy Settings to ALl User accounts and still your new format not getting applied to IIS hosted WebProject.Than you must try to go to APplication Pool Idnetity and Change the User Account and then again try to copy settings to All User accounts. Get reference from here it worked for me How to Set date and time format in IIS

    0 讨论(0)
提交回复
热议问题