Possible to explicitly set the timestamp of an event?

We are migrating lots of data from an older relational database with a fairly normalized “snapshot” style data model. We need to preserve past history, as in, when things occurred. In that light, is it possible to explicitly set the timestamp of an event as we enter it into Event Store, or does ES force the timestamp to be the moment the event is entered?

No and you shouldnt use the internal timestamp at all. What you should
use do is:

put metadata {
    effectiveTime : '...'
}

Then you can do whatever you want :slight_smile:

Just to be clear, you are referring to the event body or data payload, yes? The freeform area? Or are you referring to a specific (known) metadata property called “effectiveTime”?

every event has a data and a metadata part of the payload. This is a
perfect candidate for metadata

FWIW this is exactly what we do in our system, works great. There's a difference between when ES created the event and when it actually happened. I migrated in a couple of years worth of data from what was used before ES setup, and putting actual timestamps in metadata helped a lot.