Utente:Brodo/CURRENTHOUR

Da Wikipedia, l'enciclopedia libera.
Vai alla navigazione Vai alla ricerca

09


This template just returns the current integer hour on two digits (between 00 and 23) from the current UTC time (as set on the Wikipedia server). The shown value should match the left hand side of 09:55.

Syntax:
{{Brodo/CURRENTHOUR}}
Use {{subst:Brodo/CURRENTHOUR|subst=subst:}} to substitute the current hour.
Formula:
{{0expr|(( {{CURRENTTIMESTAMP}} -3000 round -4 ) mod 1000000 ) div 10000}}
{{subst:Brodo/CURRENTHOUR}} copies this code ready for optional substitution into another template. To avoid an obscure intermittent MOD bug for big numbers the template acually uses
( {{CURRENTTIMESTAMP}} - 10000000000 * {{CURRENTYEAR}} )
Warning:
Pages asking for the current hour often also need other parts of Template:Evaldemo, and different "current" templates and variables can reflect different timestamps near hh:mm:59.
See also:
Template:CURRENTMINUTE