Help talk:Variable
![]() | This redirect does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||
|
Localtime
editMaybe there is a mistake in Section Local Time... should the Variables for Localtime be LOCALTIME? Not CURRENTTIME? This is the same as above. —Preceding unsigned comment added by 145.253.2.27 (talk) 10:26, 19 May 2008 (UTC)
Thanks for this comment. You are right. LOCALDAY, LOCALMONTH etc work properly. —Preceding unsigned comment added by 75.157.238.138 (talk) 02:10, 1 September 2008 (UTC)
Function ns allows end text
edit24-Sep-2007: I've been testing the namespace function 'ns' for use as a numeric-validation trick for numbers above 20 (as in "{{ns: 12,567}}"), and it returns "Help" or "Talk" or "Category_talk" when letters or commas are inside a number. When the data begins with a letter, then function 'ns' tries to call the named template; however, it accepts ending letters/commas as okay in numeric data. Some examples:
- {{ns: 12567}} returns "" (empty string, valid number);
- {{ns: 12,567}} returns "Help" (not numeric);
- {{ns: 12x567}} returns "Help" (not numeric);
- {{ns: 1}} returns "Talk" (NOT valid number);
- {{ns: 4}} returns "Wikipedia" (INVALID number);
- {{ns: 12}} returns "Help" (INVALID number);
- {{ns: 120}} returns "" (valid number);
- {{ns: 21}} returns "" (valid number);
- {{ns: 567ab}} returns "" (valid number);
- {{ns: 567px}} returns "" (valid number);
- Function 'ns' cannot detect "px" ending a size parameter.
- {{ns: 567,}} returns "" (valid number);
- Apparently, text/commas after a number are allowed (!).
- {{ns: 12xx567}} returns "Help" (not numeric);
- {{ns: a12567}} returns "{{ns: a12567}}" (not numeric);
- {{ns: a12,567}} returns "{{ns: a12,567}}" (not numeric);
- Apparently, leading alpha causes the named template to be called.
- So "one man's bug is another man's feature bizarro".
- {{ns: mydog2}} returns "{{ns: mydog2}}" (not numeric);
- {{ns: ,12,567}} returns "{{ns: ,12,567}}" (not numeric);
- {{ns: 12,567,000}} returns "Help" (not numeric);
- {{ns: 12567000}} returns "" (valid number);
- {{ns: 12.567}} returns "Help" (NOT numeric!!);
- Apparently, some valid decimal fraction numbers are rejected (!).
- {{ns: 12.056}} returns "Help" (not numeric!);
- {{ns: 12.05}} returns "Help" (not numeric!);
- {{ns: 12567.000}} returns "" (valid);
- {{ns: 12567.0}} returns "" (valid);
The above 23 examples show that function 'ns' works for numeric validation, somewhat (rejecting decimal "12.567"), but it is peculiar, and I would consider the passing of "567px" (as numeric) to be another software bug in 'ns' as failing to detect non-numeric "px" ending a number. However, function 'ns' does catch commas within data (not at end). -Wikid77 12:16, 25 September 2007 (UTC)
{{USERNAME}}
edit
Is there not, and if not why can't we have, a variable taking the user who is reading the page's username? There is on Uncyclopedia. Jake the Editor Man (talk) 12:15, 9 December 2007 (UTC)
Date and Time Variables
editThe second table should apparently use LOCAL variables.
To support generation of ISO 8601 date strings, the following are needed :
Day of Week Mon=1 to Sun=7 Week Number as 01 to 53 (and as 1 to 53 not needed) Corresponding year number (as 2008-12-31 is 2009-W01-3, 2006-01-01 is 2005-W52-7)
((CURRENTMINUTE)) would seem useful.
((CURRENTDAYCOUNT)) & ((CURRENTSECONDSCOUNT)) would seem useful, signed 64-bit integer from stated date.
User time
editI want to display a message which depends on the date and time that the user has on their computer. So how can I display the local time of the user - that is UTC + offset set in preferences? The WikiMedia article on MAGICWORDS suggests that time functions do use this but I have yet to find a wiki installation where it happens. Barfbagger (talk) 14:29, 20 September 2008 (UTC)
PAGESINCATEGORY
editI would like to propose a "recursive" flag to this variable item. (though R is used for returning raw numbers) It would reduce the number of "/Total" pages that people are creating to count articles to show on both portals and projects. I would volunteer to help (I am a programmer), but have no previous experience with Wikipedia internals. -- Mjquin_id (talk) 21:10, 16 November 2008 (UTC)