feat: Display received time and fix timestamp timezone conversion.

This commit is contained in:
2025-08-02 11:26:41 +08:00
parent e936fbc140
commit d57037781e
3 changed files with 4 additions and 1 deletions

View File

@@ -30,7 +30,7 @@ app.get('/api/messages', async (req, res) => {
try {
const [rows] = await db.execute(
'SELECT id, sender, recipient, subject, body, received_at FROM emails WHERE recipient LIKE ? ORDER BY received_at DESC',
'SELECT id, sender, recipient, subject, body, CAST(received_at AS CHAR) as received_at FROM emails WHERE recipient LIKE ? ORDER BY received_at DESC',
[`%${recipient}%`]
);
res.json(rows);