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

GNOME 面板時鐘自訂顯示格式:strftime 參數完整應用

編輯:Linux 教學

GNOME 面板時鐘預設選項僅支援 12/24 小時制、日期/秒顯示開關。透過 gconf-editor 可解鎖完整 strftime 格式字串,實現高度個性化時間顯示。

設定步驟

  1. 執行 gconf-editor(或 Alt+F2 輸入)。
  2. 定位至:/apps/panel/applets/applet_N/prefs(N 為時鐘 applet 編號,如 applet_1)。
  3. 將 format 鍵值改為 custom。
  4. 在 custom_format 填入 HTML + strftime 格式字串,即時生效。

範例

輸入 %Y %B %d %A %H:%M,面板顯示:2024 十一月 15 星期五 14:30。

strftime 常用格式代碼速查表

代碼意義
%a星期縮寫
%A星期全名
%b月份縮寫
%B月份全名
%c本地完整日期時間
%d日期 (01-31)
%H24小時制 (00-23)
%I12小時制 (01-12)
%j年間第幾天 (001-366)
%m月份 (01-12)
%M分鐘 (00-59)
%pAM/PM
%S秒數 (00-59)
%U周數 (週日起算)
%W周數 (週一起算)
%w星期幾 (0=週日)
%x不含時間的日期
%X不含日期的時間
%y兩位數年份
%Y四位數年份
%Z時區名稱

自由組合代碼與 HTML 標籤(如 <b>、<span color="red">),打造專屬桌面時鐘。

Copyright © Windows教程網 All Rights Reserved