Couchbase N1QL DATE_FORMAT_STR offset handling for mixed regional ISO 8601 timestamps
0 reputation · 14 Sept 2025, 10:53 UTC
Documents in the bucket store event times as ISO 8601 strings that include regional offsets, such as 2026-10-16T10:00:00+05:30, and reporting requirements call for output in a different regional time zone. Because Couchbase lacks a native DateTime type, the unresolved choice is whether to convert these strings at query time with DATE_FORMAT_STR or normalize values to UTC epoch numbers on write.
String collation for indexing requires strict ISO 8601 adherence, and mixed offsets may not sort chronologically as instants. Query-level conversion is also considered computationally expensive for large datasets, though explicit performance boundaries are not clearly documented.
Is normalization to UTC epoch numbers the only way to preserve index-friendly chronological ordering across regional offsets, or can DATE_FORMAT_STR safely convert mixed-offset ISO 8601 strings without breaking range scans? Are there documented performance limits for applying time zone conversion functions across millions of documents, or should conversion remain an application-layer responsibility?