Hi, is there a way to obtain the day of the year in wiki pages?
Like ... date('z'); ... in PHP.
I want a number starting from 0 through 365.
Thanks (and have a happy new year);
dvdgmz
Hi,
you may want to use a construct like that
{{#expr: {{#switch: {{#expr: {{CURRENTMONTH}} - 1 }} | 0 = 0 | 1 = 31 | 2 = 59 | 3 = 90 | 4 = 120 | 5 = 151 | 6 = 181 | 7 = 212 | 8 = 243 | 9 = 273 | 10 = 304 | 11 = 334 }} + {{CURRENTDAY}} }}
with ParserFunctions[1] installed. This may not work as intended in leap years.
Greets,
Wuzur aka Michael Rosenthal
[1] http://www.mediawiki.org/wiki/Extension:ParserFunctions
On Wed, Dec 31, 2008 at 10:06 AM, david dvd@enlloc.org wrote:
Hi, is there a way to obtain the day of the year in wiki pages?
Like ... date('z'); ... in PHP.
I want a number starting from 0 through 365.
Thanks (and have a happy new year);
dvdgmz
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
david wrote:
Hi, is there a way to obtain the day of the year in wiki pages?
Like ... date('z'); ... in PHP.
I want a number starting from 0 through 365.
{{#time:z}}
http://www.mediawiki.org/wiki/Extension:ParserFunctions
- -- brion
Great! Thanks a lot!
{{#time:z}} works fine.
dvdgmz
El dc 31 de 12 del 2008 a les 08:34 -0800, en/na Brion Vibber va escriure:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
david wrote:
Hi, is there a way to obtain the day of the year in wiki pages?
Like ... date('z'); ... in PHP.
I want a number starting from 0 through 365.
{{#time:z}}
http://www.mediawiki.org/wiki/Extension:ParserFunctions
- -- brion
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAklbnyEACgkQwRnhpk1wk46MjQCgoezVOZPkH9o+qVEkAMQMJiz1 VbIAoJH+y/fLAFuBaEFNiw+350JT7KFt =zC3h -----END PGP SIGNATURE-----
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org