Difference between revisions of "Template:HOUR"
Jump to navigation
Jump to search
imported>Droll (moved cat in interwiki to doc page and tidied up a bit) |
imported>Droll (opps) |
||
| Line 1: | Line 1: | ||
| − | < | + | <includeonly>{{#if: {{{1|}}} |
| {{#ifeq: {{#expr: ({{{1}}}) * 0 = 0 }} | 1 | | {{#ifeq: {{#expr: ({{{1}}}) * 0 = 0 }} | 1 | ||
| {{#ifexpr: {{mod|({{{1}}})|24}} < 10 | 0 }}{{mod|({{{1}}})|24}} | | {{#ifexpr: {{mod|({{{1}}})|24}} < 10 | 0 }}{{mod|({{{1}}})|24}} | ||
| Line 6: | Line 6: | ||
| {{#time:H|{{{1}}} }} }} }} | | {{#time:H|{{{1}}} }} }} }} | ||
| {{CURRENTHOUR}} | | {{CURRENTHOUR}} | ||
| − | }}</ | + | }}</includeonly><noinclude> |
{{Documentation}} | {{Documentation}} | ||
| − | </ | + | </noinclude> |
Revision as of 01:29, 27 August 2009
Purpose
This template simply returns the integer hour on two digits (between 00 and 23) for the time in parameter.
Syntax
- {{HOUR|time}}
- The time must be in the
hh:mmformat (between 00:00 and 23:60 or 24:00), or can be any valid numeric expression of a real number of hours (this computed numeric value is processed modulo 24). - For compatibility with some time indications that use 24:00 or 23:60 on leap seconds, or for the end of day, this template return 24 only for those two specific values. This allows correct computing of julian day timestamps.
See also
| The above documentation is transcluded from Template:HOUR/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |