Handling Date and Time Safely

Overview

DeltaTraceDB can store both:

  • Naive datetimes (values without timezone information)

  • Timezone-aware datetimes (e.g., UTC DateTime in Dart)

However, comparisons between naive and timezone-aware values are not considered equal and will evaluate to False during query filtering.

This affects search operations involving conditions like comparisons and ranges.

Why This Matters

If your DB contains mixed datetime formats, queries such as:

  • FieldGreaterThan("createdAt", someTime)

  • FieldEquals("updatedAt", someOtherTime)

may produce unexpected results.

The system does this intentionally to avoid silently incorrect comparison behavior.

Practical Notes

  • Always pick one time representation and stay consistent.

See Also

For restoring older states where timestamp alignment matters: Saving, Restoring, and Time Travel

API