[問題] 如何從ntpclient的程式碼修改成我要的時區

看板C_and_CPP (C/C++)作者 (嗯哈哈)時間15年前 (2011/05/19 11:14), 編輯推噓1(103)
留言4則, 1人參與, 最新討論串1/1
※ [本文轉錄自 Linux 看板 #1Dr8RWmp ] 作者: whothegirl (嗯哈哈) 看板: Linux 標題: [問題]如何從ntpclient的程式碼修改成我要的時區 時間: Thu May 19 10:56:30 2011 http://doolittle.icarus.com/ntpclient/ 我從此網址下載了ntpclient的程式碼,編譯過後把它放到uboot上, 執行後的date時區是UTC,可是我想要讓他顯示台灣的時區,請問要 怎麼修改? 麻煩大家了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.20.104.230 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.20.104.230

05/19 13:33, , 1F
你要的應該是設定系統的時區,跟 ntp 無關
05/19 13:33, 1F

05/19 13:34, , 2F
不同的 linux 有不同的工具來設定系統時區
05/19 13:34, 2F

05/19 13:37, , 3F
暴力的方法是直接複制timezone file到/etc/localtime
05/19 13:37, 3F

05/19 13:38, , 4F
cp /usr/share/zoneinfo/Asia/Taipei /etc/localtime
05/19 13:38, 4F
文章代碼(AID): #1Dr8inL2 (C_and_CPP)
文章代碼(AID): #1Dr8inL2 (C_and_CPP)