diff --git a/inc/common.php b/inc/common.php
index d340e90a905d3b4b17da6a7a4e6ca0ffe5b0ccb8..687d2accd08a4e0502b37c54cc7a4e41e9f41c85 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -738,7 +738,9 @@ function pageTemplate($data){
   $tpl = str_replace('@NAME@',$INFO['userinfo']['name'],$tpl);
   $tpl = str_replace('@MAIL@',$INFO['userinfo']['mail'],$tpl);
   $tpl = str_replace('@DATE@',$conf['dformat'],$tpl);
-  $tpl = strftime($tpl);
+  // we need the callback to work around strftime's char limit
+  $tpl = preg_replace_callback('/%./',create_function('$m','return strftime($m[0]);'),$tpl);
+
   return $tpl;
 }