PostHog automatically computes timestamps for captured events, but you can also set them manually. For example:
If the payload contains
sent_atfield is compared to the server time to account for clock skew. The event's
timestampis adjusted by this difference before being stored. This is the method our libraries use.
If the payload includes a
timestampis directly used as the event timestamp.
offsetis included in the payload, then this value is interpreted as milliseconds and is subtracted from the capture time recorded by the server to obtain the event timestamp. The first two alternatives have higher priority so
offsetis ignored if
Finally, as a fallback when no
offsetare included in the payload, the capture time recorded by the server is used as the event timestamp.
To ensure maximum compatibility with PostHog,
sent_at fields should be in
ISO-8601 format like