Is `timestamp > now() - 30s` valid PostgreSQL syntax?
Use `NOW() - INTERVAL '30 seconds'` in PostgreSQL. The shorthand `30s` is not the standard interval format for production-safe SQL.
If you searched for timestamp > now() - 30s, this is the PostgreSQL-safe version for 2026 workloads. Use explicit interval syntax and consistent UTC storage so short time-window checks stay reliable under traffic spikes and background job retries.
Correct pattern: compare against NOW() - INTERVAL '30 seconds'. If your events are saved as epoch integers, convert units first and avoid mixing seconds and milliseconds in the same query path.
SELECT id, created_at, payload FROM events WHERE created_at >= NOW() - INTERVAL '30 seconds' ORDER BY created_at DESC;
Compare with the multi-database variant at timestamp now minus 30s guide. Need a live reference value? Open current UTC timestamp. To decode event values during debugging, use Unix timestamp to date.
Need both conversion directions in one place? Open the main epoch converter tool.
If this query runs in a job loop, validate your schedule with Cron Expression Builder.
Use `NOW() - INTERVAL '30 seconds'` in PostgreSQL. The shorthand `30s` is not the standard interval format for production-safe SQL.
Use a proper `timestamp` or `timestamptz` column for direct comparisons. If values are stored as epoch integers, convert them consistently before comparing.
Store event times in UTC, use `timestamptz` where appropriate, and convert for user display only at the UI boundary.
Use digit length as a quick check: 10 digits is typically seconds and 13 digits is milliseconds. Normalize to one unit before SQL comparisons.