The Meta CAPI error 'Timestamp must be within 7 days of event occurrence' occurs when your payload's event_time parameter is: (1) Passed in milliseconds (13 digits) instead of unix epoch seconds (10 digits), (2) Formatted as an ISO date string (e.g. '2026-09-16T12:00:00Z') instead of an integer, (3) Corrupted by server clock drift, or (4) Truly older than 168 hours (7 days). Meta strictly mandates integer unix epoch seconds.
1. The Milliseconds vs Seconds Trap in JavaScript
JavaScript developers habitually call `Date.now()` to get the current timestamp. In JavaScript, `Date.now()` returns milliseconds (e.g. `1726521600000`—13 digits).
Meta's Graph API strictly expects unix epoch seconds (10 digits: `1726521600`). When you pass a 13-digit millisecond timestamp, Meta interprets the number as a date thousands of years in the future, instantly throwing the error: 'Timestamp must be within 7 days of event occurrence'.
- Milliseconds Unit Confusion: Passing 13-digit JavaScript timestamps instead of 10-digit seconds.
- ISO 8601 String Errors: Passing date strings instead of raw integer epoch numbers.
- Server Clock Drift: Cloud servers losing NTP synchronization by several hours.
2. Comparative Analysis: Standard Tracking vs CAPI Control
The table below outlines the architectural and financial differences between passive conversion tracking and active signal governance:
| Timestamp Format | Example Value | Meta API Response |
|---|---|---|
| JavaScript `Date.now()` | 1726521600000 (13 digits) | Rejected with error (Interpreted as year 56000) |
| ISO 8601 String | '2026-09-16T14:20:00Z' | Rejected with Error 100 (Invalid parameter type) |
| Correct Epoch Seconds | 1726521600 (10 digits) | Accepted immediately (HTTP 200 OK) |
3. Universal Unix Epoch Seconds Normalizer
Ensure your code always divides JavaScript timestamps by 1,000 and applies `Math.floor()` to produce an integer:
// Correct Timestamp Generation in Node.js / JavaScript
export function getMetaTimestamp(dateInput = null) {
const ms = dateInput ? new Date(dateInput).getTime() : Date.now();
// Divide by 1000 and floor to get pure 10-digit unix epoch seconds
const seconds = Math.floor(ms / 1000);
// Failsafe check: Ensure timestamp is not older than 7 days (604,800 seconds)
const currentSeconds = Math.floor(Date.now() / 1000);
if (currentSeconds - seconds > 604800) {
console.warn("Timestamp is older than 7 days: Capping to current time.");
return currentSeconds;
}
return seconds;
}
How to Deploy CAPI Control to Fix This Today
- Step 1: Audit your codebase for calls to `Date.now()` in CAPI payload formatters.
- Step 2: Ensure timestamps are divided by 1,000 and passed as integers.
- Step 3: Verify that your application servers run active NTP time synchronization.
- Step 4: Deploy CAPI Control to automatically sanitize timestamp formats at the edge.
Frequently Asked Questions
Can I upload offline purchases that happened 30 days ago?
Standard web CAPI requires events within 7 days. For purchases older than 7 days, you must use Meta's Offline Conversions API endpoints, which support events up to 90 days old.
Can timestamps be set in the future?
No. Timestamps greater than 60 seconds into the future are rejected by Meta's validation engine.
Does timezone matter for epoch seconds?
No. Unix epoch seconds are mathematically identical across all timezones globally, representing the number of seconds elapsed since January 1, 1970 UTC.
Ready to steer Meta & Google toward your most profitable traffic?
Drop in CAPI Control in under 2 minutes. Transmit 100% of conversion signals free forever, or activate autonomous signal AI agents to get 3x better ad traffic.