Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> 關於 Windows

Windows Server 2008 修改日期時間格式教學:從 YYYY/MM/DD 改為 YYYY-MM-DD

編輯:關於 Windows

Windows Server 2008 的 IIS 7.0 與 ASP 存取資料庫時,預設日期格式為 YYYY/MM/DD,若需改為 YYYY-MM-DD 格式,需分別在「控制面板」與「登錄編輯器」中進行設定。

操作步驟

方法一:控制面板區域設定

  1. 開啟「控制面板」→「區域及語言選項」。
  2. 點擊「自訂此格式」→ 選擇「日期」索引標籤。
  3. 在「簡短日期」格式中選擇或輸入 yyyy-M-d,確定儲存。

方法二:修改登錄表

  1. 執行 Win + R 輸入 regedit 開啟登錄編輯器。
  2. 瀏覽至路徑:
    HKEY_USERS\.DEFAULT\Control Panel\International
  3. 在右側窗格修改以下兩個字串值:
    - sDate 值改為 -
    - sShortDate 值改為 yyyy-M-d
  4. 重新啟動電腦使設定生效。

補充說明: Windows Server 2008 預設為 YYYY/MM/DD,而 Windows 2000/2003 預設為 YYYY-MM-DD。許多舊版程式未考慮格式差異,導致移轉至 Server 2008 時出現日期解析錯誤,透過上述設定即可解決相容性問題。

Copyright © Windows教程網 All Rights Reserved