Index: src/services/ActivityPubService.js
===================================================================
--- src/services/ActivityPubService.js	(revision 9946a68c3cdf4796d3e5ab4c7f6e3317e0f40984)
+++ src/services/ActivityPubService.js	(revision 1d1fdc97939238a96492ef7adccedc1b08f51985)
@@ -19,5 +19,5 @@
 import fs from 'fs';
 import path from 'path';
-import db, { NU_ISO } from '../config/database.js';
+import db, { NU_ISO, isoSql } from '../config/database.js';
 import HtmlSanitizerService from './HtmlSanitizerService.js';
 import AudioEmbedService from './AudioEmbedService.js';
@@ -1143,5 +1143,5 @@
   const fanClause = fanOnly ? '' : 'AND (p.fan_only IS NULL OR p.fan_only = 0)';
   const unie = `
-    SELECT 'post' AS soort, p.id AS id, COALESCE(p.published_at, p.created_at) AS wanneer
+    SELECT 'post' AS soort, p.id AS id, ${isoSql('COALESCE(p.published_at, p.created_at)')} AS wanneer
       FROM posts p WHERE p.site_id = ? AND p.status = 'published' ${fanClause}
     UNION ALL
@@ -1927,5 +1927,5 @@
      FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
        AND IFNULL(ap_visibility, 'public') = 'public'
-     ORDER BY COALESCE(published_at, created_at) DESC LIMIT 20`
+     ORDER BY ${isoSql('COALESCE(published_at, created_at)')} DESC LIMIT 20`
   ).all(site.id).reverse();
   if (!recent.length) return;
@@ -2085,5 +2085,5 @@
     `SELECT id FROM posts WHERE site_id = ? AND status = 'published' AND (fan_only IS NULL OR fan_only = 0)
        AND pinned IS NOT NULL AND pinned > 0
-     ORDER BY pinned DESC, COALESCE(published_at, created_at) ASC LIMIT 20`
+     ORDER BY pinned DESC, ${isoSql('COALESCE(published_at, created_at)')} ASC LIMIT 20`
   ).all(site.id);
   const removeIds = [...new Set([...pinned.map((p) => p.id), ...alsoRemove])];
