Cookbook /
MarkupExpressions-Sandbox
Feel free to use this page to experiment with the MarkupExpressions recipe (superceded by PmWiki.Markup Expressions)
rand
{(rand)} | {(rand 01 20)} | {(rand 1 20)} |
1632064277 | 9 | 4 |
ftime
See http://www.php.net/strftime for date/time parameters.
MyDate:2007-04-12
now: {(ftime)} date: {(ftime %F)} yesterday: {(ftime %F yesterday)} tomorrow: {(ftime %F tomorrow)} April 31st: {(ftime %F "2007-04-30 +1 day")} Unix time: {(ftime '' @1176304315)} fmt=%s {(ftime %s)} offset: {(ftime '' "@1176304315 +3 hours")} reversed arguments: {(ftime when=now fmt=%F)} page-text-variable: {(ftime '%A %B %e, %Y' {$:MyDate})} {(ftime '%A %B %e, %Y' '{$:MyDate} -2days')} |
now: December 26, 2024, at 04:43 PM date: 2024-12-26 yesterday: 2024-12-25 tomorrow: 2024-12-27 April 31st: 2007-05-01 Unix time: December 26, 2024, at 04:43 PM fmt=%s 1735231418 offset: December 26, 2024, at 04:43 PM reversed arguments: 2024-12-26 page-text-variable: Thursday April 12, 2007 Tuesday April 10, 2007 |
{(ftime '%b %d, %Y %I:%M %p')} | Dec 26, 2024 04:43 PM |
substr
{(substr "Hello World" 2 5)} | llo W |
{(substr {$Name} 2 3)} | rku |
''Separately:'' {(ftime '%A, %d %B, %Y' 20071019)} {(substr 20071019-SomeHybridPageName 0 8)} ''Wrong:'' {(ftime '%A, %d %B, %Y' 20071019-SomeHybridPageName)} {(ftime '%A, %d %B, %Y' {(substr 20071019-SomeHybridPageName 0 8)})} ''Right:'' {(ftime '%A, %d %B, %Y' (substr 20071019-SomeHybridPageName 0 8))} | Separately: Friday, 19 October, 2007 20071019 Wrong: Friday, 19 October, 2007 (ftime d Y {20071019)} Right: Friday, 19 October, 2007 |
fmt=#datenames
Use with pagelist that specifies name=20[0-9][0-9][0-9][0-9]* (e.g. 20071019)
(:if false:) [[#datenames]] * [[{=$FullName}|{(ftime '%a, %d %b, %Y' (substr {=$Name} 0 8))}]] [[#datenamesend]] (:ifend:) (:pagelist group=Test name=20[0-9][0-9][0-9][0-9]* fmt=#datenames count=5:) |
pagename
{(pagename "Try this. Really. Test's pages:fun or not?")} {(pagename "Try this Really Test's pages:fun or not?")} {(pagename Donald O'Connel)} |
Cookbook.TryThisReallyTestsPagesFunOrNot Cookbook.DonaldOConnel |
Variable : 23 {$:Variable} {(eval {$:Variable}+2)} |
Variable : 23 23 (eval 23+2) |