メインメニューを開く
ホーム
おまかせ表示
ログイン
設定
14Channel BBS Wikiについて
免責事項
14Channel BBS Wiki
検索
「
テンプレート:Gregorian serial date
」を編集中
警告:
ログインしていません。編集を行うと、あなたの IP アドレスが公開されます。
ログイン
または
アカウントを作成
すれば、あなたの編集はその利用者名とともに表示されるほか、その他の利点もあります。
スパム攻撃防止用のチェックです。 けっして、ここには、値の入力は
しない
でください!
<includeonly>{{#expr: <!--Days from all years past:--> + (({{{year|{{CURRENTYEAR}}}}} - 1) * 365) + ((({{{year|{{CURRENTYEAR}}}}} - 1) - (({{{year|{{CURRENTYEAR}}}}} - 1) mod 4)) / 4) <!--add a day for every leap--> - ((({{{year|{{CURRENTYEAR}}}}} - 1) - (({{{year|{{CURRENTYEAR}}}}} - 1) mod 100)) / 100) <!--subtract 100 year exception--> + ((({{{year|{{CURRENTYEAR}}}}} - 1) - (({{{year|{{CURRENTYEAR}}}}} - 1) mod 400)) / 400) <!--readd 400 year exception--> <!--Days so far this year:--> + {{ #ifexpr: <!--add days for past months this year--> <!--Gives 1 or 2 extra days because of February--> ({{{month|{{CURRENTMONTH}}}}} - 1) < 8 | ( ({{{month|{{CURRENTMONTH}}}}} - 1) * 30.5 round 0) | ( ({{{month|{{CURRENTMONTH}}}}} - 1) * 30.5 + 0.9 round 0 ) }} - {{ #ifexpr: ({{{month|{{CURRENTMONTH}}}}} <= 2) | 0 | {{ #ifexpr: <!-- if leap year --> ({{{year|{{CURRENTYEAR}}}}} / 4) = ({{{year|{{CURRENTYEAR}}}}} / 4 round 0) <!--If divisible by 4--> and ({{{year|{{CURRENTYEAR}}}}} / 100 != {{{year|{{CURRENTYEAR}}}}} / 100 round 0) <!--and not by 100--> | 1 | 2 }} }} + {{ #ifexpr: ({{{month|{{CURRENTMONTH}}}}} <= 2) | 0 | {{ #ifexpr: <!--400 year exception--> ({{{year|{{CURRENTYEAR}}}}} / 400) = ({{{year|{{CURRENTYEAR}}}}} / 400 round 0) | 1 | 0 }} }} + {{{day|{{CURRENTDAY}}}}} }}{{#ifexpr: {{{year|{{CURRENTYEAR}}}}} < 1 | _ERROR - Can not handle dates before January 1, 1 A.D. }}</includeonly> <noinclude> 紀元1年1月1日から任意の日付まで何日が経過しているかを示すテンプレートです。 ==概要== グレゴリウス暦(グレゴリオ暦)はユリウス暦に変わり現在世界で使用されている太陽暦です。 そのグレゴリウス暦を用いた日付が紀元より何日経過しているかを知ることができます。 Wikipediaの{{wpl|Template:Gregorian_serial_date}}よりソースコードを拝借しています。 {| class="wikitable" ! !! 入力 !! 出力 |- |入力例 |<pre>{{Gregorian serial date|year=<!--年-->|month=<!--月-->|day=<!--日-->}}</pre> |求めたい日付 |- |命日 |<pre>{{Gregorian serial date|year=2022|month=7|day=8}}</pre> |{{Gregorian serial date|year=2022|month=7|day=8}} |- |未入力 |<pre>{{Gregorian serial date}}</pre> |{{Gregorian serial date}} |} 差を用いれば任意の日付間の日数の差を求めることも可能です。<br> 今日まで何日かは[[テンプレート:Start date and date]]を使用してください。<br> 例:誕生から死亡まで何日間か {| class="wikitable" ! !! 入力 !! 出力 |- |例 |<pre>{{#expr:{{Gregorian serial date|year=2022|month=7|day=8}}-{{Gregorian serial date|year=1954|month=9|day=21}}}}日</pre> |{{#expr:{{Gregorian serial date|year=2022|month=7|day=8}}-{{Gregorian serial date|year=1954|month=9|day=21}}}}日 |} ==仕組み・注意点== *閏年が考慮されており正確な日数を知ることができる *未入力時は現在の日付が反映される *1582年10月15日以前は使用が推奨されない(日本の場合1873年1月1日以前) :*グレゴリウス暦が採用されておらず計算が狂う可能性があるため *基準となっている時間が'''UTC'''のため値が1増えるのは'''午前九時(JST)'''である [[カテゴリ:テンプレート]] </noinclude>
編集内容の要約:
14Channel BBS Wikiへの投稿はすべて、他の投稿者によって編集、変更、除去される場合があります。 自分が書いたものが他の人に容赦なく編集されるのを望まない場合は、ここに投稿しないでください。
また、投稿するのは、自分で書いたものか、パブリック ドメインまたはそれに類するフリーな資料からの複製であることを約束してください(詳細は
14Channel BBS Wiki:著作権
を参照)。
著作権保護されている作品は、許諾なしに投稿しないでください!
編集を中止
編集の仕方
(新しいウィンドウで開きます)
このページで使用されているテンプレート:
テンプレート:Gregorian serial date
(
編集
)
テンプレート:Wpl
(
編集
)