(bug 5727) Time magic words should use $wgLocaltimezone instead of UTC:
1. Not using anymore the functions wfTimestamp (for {{CURRENTTIME}}) and wfTimestampNow (for {{CURRENTTIMESTAMP}}) for the time magic words, because they output a UTC date; instead, using the built-in function "date" with the parameters "YmdHis".
2. Fix number 1 makes the time magic words OK when using the server default timezone (actually, all of them were OK except {{CURRENTIME}} and {{CURRENTTIMESTAMP}}), but the problem is still exist when setting $wgLocaltimezone, as it isn't noticed. Therefore, setting the timezone to "TZ" enviroment variable like in the signature, getting the various dates and times by "date" function, then setting the "TZ" to its previous value.