Jump to content

User talk:NYKevin/Swatch timestamp

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

ParserFunctions explained

[edit]

@{{<includeonly>subst:</includeonly>#expr: (((({{<includeonly>subst:</includeonly>#time:s}}) / 60) / 60 + {{<includeonly>subst:</includeonly>#time:i}} / 60 + ({{<includeonly>subst:</includeonly>#time:G}} + 1) <includeonly>subst:</includeonly>mod 24) / 24 * 1000) round 0}} At first, this appears to be a daunting array of meaningless code, but it's actually quite simple:

  1. <includeonly>subst:</includeonly> means substitute this only when transcluding or substituting. Substituting when transcluding gives an error.
  2. {{#expr:(((( means "treat the following as a mathematical expression, using specified syntax at meta:Help:ParserFunctions and meta:Help:Calculation.
  3. {{#time:s}}) / 60) / 60 means seconds converted to hours
  4. {{#time:i}} / 60 means minutes converted to hours
  5. ({{#time:G}} + 1) mod 24) this means hours in 24 hour format, converted to BMT or GMT + 1, and converts 24:00 into 0:00
  6. / 24 * 1000) round 0}} convert to .beats, remove resulting decimal point and prevent decimal results.

for more information, please see meta:Help:ParserFunctions. -- Thinboy00 talk/contribs 00:08, 19 October 2007 (UTC)[reply]

more specifically, <includeonly>subst:</includeonly> prevents it from being subst'ed until inclusion, but not quite the way you might think, see meta:Help:Substitution#Includeonly. This is not a novel technique and has been used in many templates. -- Thinboy00 talk/contribs 00:47, 19 October 2007 (UTC)[reply]

Swatch Internet Time Code Error

[edit]

Hi, you may want to replace the round functions in your Swatch Internet Time code with truncation functions. At the moment, the current code for Swatch Internet Time is 43.2 seconds of half a beat fast. Also, in between 22:59:17 and 22:59:59, the code gives the Swatch Internet Time as @000, instead of @999. Hope this helps.   Set Sail For The Seven Seas  242° 17' 0" NET   16:09, 1 September 2009 (UTC)[reply]