模板:Start date

維基教科書,自由的教學讀本
文檔圖示 模板文檔[檢視] [編輯] [歷史] [清除快取]

Lua錯誤 在package.lua的第80行:module 'Module:Transclusion_count/data/S' not found

模板{{Start date}}{{End date}}會傳回一個日期值,又或日期與時間的值。這個值傳回的同時,還附帶一個隱藏的ISO日期格式(以CSS實現),以供微格式使用。當用戶端不能使用CSS時,這個隱藏的日期會自動降格。

何時不應使用這一模板?[編輯]

Do not use this template for:

  • dates that are uncertain e.g. "before 4 April 1933"; "around 18 November 1939".
  • dates outside the range given under "Limitation", below.
  • other, secondary dates
  • outside microformat-emitting templates - if in doubt, see the parent template's documentation
  • more than one date in any parent template

用法[編輯]

  • {{start date|year|month|day}}
  • {{start date|year|month|day|HH|MM|SS|TimeZone}} (MM and SS are optional; TimeZone may be a numerical value, or "Z" for UTC; see examples)
例子:
  • {{start date|1993}} → "1993年 (1993)"
  • {{start date|1993|02}} → "1993年2月 (1993-02)"
  • {{start date|1993|02|24}} → "1993年2月24日 (1993-02-24)"
  • {{start date|1993|02|24|08|30}} → "1993年2月24日 08:30 (1993-02-24T08:30)"
  • {{start date|1993|02|24|08|||+01:00}} → "1993年2月24日 (+01:00) (1993-02-24T08+01:00)"
  • {{start date|1993|02|24|08|||-07:00}} → "1993年2月24日 (-07:00) (1993-02-24T08-07:00)"
  • {{start date|1993|02|24|08|30|23}} → "1993年2月24日 08:30:23 (1993-02-24T08:30:23)"
  • {{start date|1993|02|24|08|30|23|Z}} → "1993年2月24日 08:30:23 (UTC) (1993-02-24T08:30:23Z)"
  • {{start date|1993|02|24|08|30|23|+01:00}} → "1993年2月24日 08:30:23 (+01:00) (1993-02-24T08:30:23+01:00)"
  • {{start date|1993|02|24|08|30|23|-07:00}} → "1993年2月24日 08:30:23 (-07:00) (1993-02-24T08:30:23-07:00)"

原來的英文版有 df 選項,當這選項被設定時,會強制日期以歐洲式(即 日/月/年 ,而非北美式的 月/日/年)顯示。這個選項在中文版無效。例如:

  • {{Start date|1993|02|24|08|30|df=yes}} 仍然顯示為 年/月/日: "1993年2月24日 08:30 (1993-02-24T08:30)"

注意:

如果year參數留空的話,即使後面有填入month、day參數也不會顯示:

  • {{Start date| |02|24}} 返回 " ()"(空白)

如果有year、day參數無month參數,只顯示年份,其它情況如此類推:

  • {{Start date|1993| |24}} 返回 "1993年 (1993)"

Parameters[編輯]

這是用於新版視覺化編輯器及其他工具的模板資料文件。

Start date模板資料

Date that an event or entity started or was created

模板參數[編輯模板資料]

參數描述類型狀態
YYYY1

start year

數值選填
MM2

start month

數值選填
DD3

start day of month

數值選填
HH4

start hours

數值選填
MM5

start minutes

預設
0
數值選填
SS6

start seconds

預設
0
數值選填
TZ7

time zone offset, 「+02:00」, 「-06:00」 or 「Z」 for UTC

選填
day firstdf

boolean parameter to put the date before the month name

預設
false
選填

使用微格式[編輯]

中文維基暫無該微格式模板。

詳情請看 微格式專題

參看[編輯]