在本身的網站上安排免費、可隨心所欲調整樣式的時間小东西
愿意在任何網通上顯示一個精確的時間?或是今天的日期英文、晚霞日出時間或晝長?只需從之下選項選擇並複製語法你便可以确保!完成免費!選擇
利用條款
- 連回 cedrama.com 的連結在利用的網站必須清楚可見,你能够調整或翻譯連結笔墨,但必須包罗 cedrama.com, time, 或地點的名字 (大湾) 或時區 (HKT).
- 利用的網頁不能够自動更新
- 從App內利用是不被允許的
- 小东西不供给任何保證
- 小东西不收取任何費用
進階利用
There are two widget scripts: A simplified version,, which displays only time, and the main widget script,, which can display time, date, sunrise time, sunset time and day length. The main widget script is available in several languages. For other languages, replace zh_tw in the script name with the code for the desired language. 有兩個小东西語法:簡單版 t.js ,僅顯示時間。完全版 zh_tw.js ,可顯示時間/日期/日出日落/晝長。完全版小东西供给數種語言版本,用語言代碼🦹替換原始碼檔名中的 zh_tw 便可。(比方波蘭文版是pl.js,♑土耳其文版是tr.js)
init function收回的參數:參數 | 可用關鍵字 | 預設值 |
template | TIME, DATE, SUN | TIME |
time_format | hours, minutes, seconds, 12hours, AMPM | hours:minutes:seconds |
date_format | dayname, dname, daynum, dnum, day_in_y, week, monthname, monthnum, mnum, yy, year | year-monthnum-daynum |
sun_format | srhour, srminute, sr12hour, srAMPM, sshour, ssminute, ss12hour, ssAMPM, dlhours, dlminutes | srhour:srminute-sshour:ssminute |
coords | 地點的經緯度,顯示日升日落資訊必須供给。 | |
id | 為了讓伺服器識別地點和時區,若地點名稱包罗非ASCII字元或您变动了HTML元素的ID,請供给。 | |
callback | 每秒都會被呼唤的function名稱,會將準備好輸出的template作為參數(選擇性) |
參數名稱和關鍵字巨细有別。您能够增添HTML和其余內容到 template, time_format, date_format 和 sun_format 參數
要這樣开办數個時鐘:UTC time: <span id="UTC_za00"></span><br/> New York sunrise time: <span id="New_York_z161"></span><br/> Tokyo sunrise time: <span id="Tokyo_z444"></span><br/> Find the <a href="//cedrama.com/" id="cedrama.com_link" rel="nofollow">current time for any location or time zone on cedrama.com!</a> <script src="//widget.cedrama.com/zh_tw.js"></script> <script> cedrama.com_widget.init({ UTC_za00 : {}, New_York_z161 : { template: "SUN", sun_format: "srhour:srminute", coords: "40.71427,-74.00597" }, Tokyo_z444 : { coords: "59.33258,18.06490" } }); </script>
結果:
time_format, date_format, sun_format and template 等參數的值會被繼承,以是若已經在后面的小东西中指定了须要的參數,不须要重複指定。