diff --git a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java
index 07a9f2f..d6fe538 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/posts/PostResource.java
@@ -78,17 +78,6 @@
 
 public abstract class PostResource {
 
-  private static final DateTimeFormatter htmlDateTimeFormatter =
-      DateTimeFormatter.ISO_OFFSET_DATE_TIME;
-
-  private static final DateTimeFormatter humanDateTimeFormatter =
-      DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG, FormatStyle.SHORT);
-
-  private static final DateTimeFormatter htmlDateFormatter = DateTimeFormatter.ISO_LOCAL_DATE;
-
-  private static final DateTimeFormatter humanDateFormatter =
-      DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG);
-
   private static final String hashcashDigestAlgorithm = "SHA-256";
 
   private static final int pageKeyBytes = 32;
@@ -496,42 +485,6 @@
     return wireFeedOutput.outputString(feed);
   }
 
-  @TemplateExtension
-  @CheckForNull
-  static String humanDateTime(@CheckForNull TemporalAccessor x) {
-    if (x == null) {
-      return null;
-    }
-    return humanDateTimeFormatter.format(x);
-  }
-
-  @TemplateExtension
-  @CheckForNull
-  static String htmlDateTime(@CheckForNull TemporalAccessor x) {
-    if (x == null) {
-      return null;
-    }
-    return htmlDateTimeFormatter.format(x);
-  }
-
-  @TemplateExtension
-  @CheckForNull
-  static String humanDate(@CheckForNull TemporalAccessor x) {
-    if (x == null) {
-      return null;
-    }
-    return humanDateFormatter.format(x);
-  }
-
-  @TemplateExtension
-  @CheckForNull
-  static String htmlDate(@CheckForNull TemporalAccessor x) {
-    if (x == null) {
-      return null;
-    }
-    return htmlDateFormatter.format(x);
-  }
-
   private boolean showBookmarkForm() {
     switch (postFilter) {
       case ALL:
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
index edf9c72..4100dc2 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
@@ -37,11 +37,6 @@
 @Path("/wiki")
 public class WikiResource {
 
-  private static final DateTimeFormatter htmlDateFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
-
-  private static final DateTimeFormatter humanDateFormatter =
-      DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG, FormatStyle.SHORT);
-
   private static final JsonProvider jsonProvider = JsonProvider.provider();
 
   @CheckedTemplate(basePath = "benki/wiki")
@@ -158,22 +153,4 @@
 
     return Templates.wikiPageRevisionList(page, pageName);
   }
-
-  @TemplateExtension
-  @CheckForNull
-  static String humanDateTime(@CheckForNull TemporalAccessor x) {
-    if (x == null) {
-      return null;
-    }
-    return humanDateFormatter.format(x);
-  }
-
-  @TemplateExtension
-  @CheckForNull
-  static String htmlDateTime(@CheckForNull TemporalAccessor x) {
-    if (x == null) {
-      return null;
-    }
-    return htmlDateFormatter.format(x);
-  }
 }
diff --git a/src/main/java/eu/mulk/mulkcms2/common/template/TemporalExtensions.java b/src/main/java/eu/mulk/mulkcms2/common/template/TemporalExtensions.java
new file mode 100644
index 0000000..35d6d32
--- /dev/null
+++ b/src/main/java/eu/mulk/mulkcms2/common/template/TemporalExtensions.java
@@ -0,0 +1,58 @@
+package eu.mulk.mulkcms2.common.template;
+
+import io.quarkus.qute.TemplateExtension;
+import java.time.format.DateTimeFormatter;
+import java.time.format.FormatStyle;
+import java.time.temporal.TemporalAccessor;
+import javax.annotation.CheckForNull;
+
+public class TemporalExtensions {
+
+  private static final DateTimeFormatter htmlDateTimeFormatter =
+      DateTimeFormatter.ISO_OFFSET_DATE_TIME;
+
+  private static final DateTimeFormatter humanDateTimeFormatter =
+      DateTimeFormatter.ofLocalizedDateTime(FormatStyle.LONG, FormatStyle.SHORT);
+
+  private static final DateTimeFormatter htmlDateFormatter = DateTimeFormatter.ISO_LOCAL_DATE;
+
+  private static final DateTimeFormatter humanDateFormatter =
+      DateTimeFormatter.ofLocalizedDate(FormatStyle.LONG);
+
+  @TemplateExtension
+  @CheckForNull
+  static String humanDateTime(@CheckForNull TemporalAccessor x) {
+    if (x == null) {
+      return null;
+    }
+    return humanDateTimeFormatter.format(x);
+  }
+
+  @TemplateExtension
+  @CheckForNull
+  static String htmlDateTime(@CheckForNull TemporalAccessor x) {
+    if (x == null) {
+      return null;
+    }
+    return htmlDateTimeFormatter.format(x);
+  }
+
+  @TemplateExtension
+  @CheckForNull
+  static String humanDate(@CheckForNull TemporalAccessor x) {
+    if (x == null) {
+      return null;
+    }
+    return humanDateFormatter.format(x);
+  }
+
+  @TemplateExtension
+  @CheckForNull
+  static String htmlDate(@CheckForNull TemporalAccessor x) {
+    if (x == null) {
+      return null;
+    }
+    return htmlDateFormatter.format(x);
+  }
+
+}
