Skip to content

date truncation behaviour inconsistent with nanos #6245

@nwoolmer

Description

@nwoolmer

To reproduce

DECLARE @ts := '2025-09-03T23:00:00.662945145Z'
SELECT @ts::date as millis, @ts::timestamp as micros, @ts::timestamp_ns as nanos;
millis micros nanos
null 2025-09-03T23:00:00.662945Z 2025-09-03T23:00:00.662945145Z
DECLARE @ts := '2025-09-03T23:00:00.662945Z'
SELECT @ts::date as millis, @ts::timestamp as micros, @ts::timestamp_ns as nanos;
millis micros nanos
null 2025-09-03T23:00:00.662945Z 2025-09-03T23:00:00.662945000Z
DECLARE @ts := '2025-09-03T23:00:00.662Z'
SELECT @ts::date as millis, @ts::timestamp as micros, @ts::timestamp_ns as nanos;
millis micros nanos
2025-09-03T23:00:00.662Z 2025-09-03T23:00:00.662000Z 2025-09-03T23:00:00.662000000Z

Expectation: the timestamps should be upscaled and downscaled consistently.

QuestDB version:

9.1.0+

OS, in case of Docker specify Docker and the Host OS:

N/A

File System, in case of Docker specify Host File System:

N/A

Full Name:

Nick Woolmer

Affiliation:

QuestDB

Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?

  • Yes, I have

Additional context

No response

Metadata

Metadata

Assignees

Labels

Bug 0Bug with 0 (lowest) priorityinternal

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions