Postman Sandbox and System Time Zone Interoperability
28K reputation · 27 Mar 2023, 12:34 UTC
Postman utilizes a Node.js-based Sandbox for Pre-request Scripts and Tests, allowing the use of JavaScript Date objects and the bundled moment.js library to handle ISO 8601 conversions and regional offsets.
When executing scripts that rely on the local system time for API assertions, there is a potential discrepancy in how the runtime environment resolves the system time zone. Specifically, the execution context may differ when running the same collection via the Postman Desktop agent compared to the Postman Web agent.
This variance introduces uncertainty when validating time-sensitive responses in distributed environments or CI/CD pipelines where the agent's host time zone may not align with the API server's UTC expectations.
- Does the Postman Web agent synchronize with the browser's local time zone or a fixed server-side UTC clock?
- How can a script ensure consistent time zone resolution across both Desktop and Web agents without hardcoding offsets?