TimstampDiff functions

This commit is contained in:
Yurii
2026-05-22 15:08:18 +03:00
parent dce1dabdee
commit 7803cf0692
2 changed files with 42 additions and 2 deletions

View File

@@ -346,10 +346,10 @@ class PostgresqlQueryComposer extends BaseQueryComposer
return "FLOOR(($toEpoch - $fromEpoch) / (3600 * 24))";
case 'TIMESTAMPDIFF_HOUR':
return "($toEpoch - $fromEpoch) / 3600";
return "FLOOR(($toEpoch - $fromEpoch) / 3600)";
case 'TIMESTAMPDIFF_MINUTE':
return "($toEpoch - $fromEpoch) / 60";
return "FLOOR(($toEpoch - $fromEpoch) / 60)";
case 'TIMESTAMPDIFF_SECOND':
return "$toEpoch - $fromEpoch";