# Your database is lying to you about time

DevFeed: [Your database is lying to you about time](<https://devfeed.tech/articles/your-database-is-lying-to-you-about-time-113336.md>)

Original publisher: [Read original article](<https://stack.convex.dev/your-database-is-lying-about-time>)

Author: Stack

Published: 2026-10-27T15:30:22Z

Content type: article

Language: en

Sources: [Stack](<https://devfeed.tech/sources/stack.md>)

Topics: [Database](<https://devfeed.tech/topics/database.md>), [Transactions](<https://devfeed.tech/topics/transactions.md>), [database-consistency](<https://devfeed.tech/topics/database-consistency.md>), [database-optimization](<https://devfeed.tech/topics/database-optimization.md>)

Tags: [actions](<https://devfeed.tech/tags/actions.md>), [algolia](<https://devfeed.tech/tags/algolia.md>), [async](<https://devfeed.tech/tags/async.md>), [await](<https://devfeed.tech/tags/await.md>), [backend](<https://devfeed.tech/tags/backend.md>), [background](<https://devfeed.tech/tags/background.md>), [backups](<https://devfeed.tech/tags/backups.md>), [batch](<https://devfeed.tech/tags/batch.md>), [bigint](<https://devfeed.tech/tags/bigint.md>), [client](<https://devfeed.tech/tags/client.md>), [clock](<https://devfeed.tech/tags/clock.md>), [commit](<https://devfeed.tech/tags/commit.md>), [commits](<https://devfeed.tech/tags/commits.md>), [convex](<https://devfeed.tech/tags/convex.md>), [database](<https://devfeed.tech/tags/database.md>), [mutation](<https://devfeed.tech/tags/mutation.md>), [order](<https://devfeed.tech/tags/order.md>), [patterns](<https://devfeed.tech/tags/patterns.md>), [time](<https://devfeed.tech/tags/time.md>), [times](<https://devfeed.tech/tags/times.md>), [timestamps](<https://devfeed.tech/tags/timestamps.md>)

## AI overview

Convex mutations return a stable `Date.now()` value assigned when the transaction starts, and `_creationTime` is based on that same start time. Concurrent transactions can therefore commit out of timestamp order, causing a batch job that advances a timestamp cursor to miss late commits. For strict commit-order traversal, Convex 1.43 adds opt-in `v.commitTs()` fields, set with `ctx.db.vars.commitTs` and indexed; their values become comparable `bigint`s after commit. In Convex 1.47, `ctx.meta.getSnapshotTs()` lets a job bound each query to its snapshot, avoiding conflicts with newer writes. The article says ordinary display timestamps can remain `Date.now()` values, and strict ordering is mainly useful when processing ordered batches or scanning past many deleted records. Commit timestamps currently cannot be used as scheduled-function arguments.

## Source excerpt

Date.now() in a Convex mutation isn't actually now, and _creationTime doesn't follow the order things were committed in. Ian sat me down at a whiteboard to explain the three times in a database, how you can miss rows, and how commit timestamps fix it.