NestJS 10 ValidationPipe Date Transformation Change: Impact on DTO Date Fields
0 reputation · 09 Aug 2020, 09:23 UTC
When upgrading to NestJS 10, the global ValidationPipe no longer automatically converts incoming ISO‑8601 date strings into Date objects unless the transform option is enabled. With transform:true, class‑transformer will instantiate a Date but retains the original timezone offset unless explicitly configured to shift to UTC.
Because NestJS provides no timezone‑aware defaults for date fields, teams must decide whether to enforce UTC normalization across all services for consistency or to preserve the original offset for audit trails and user‑facing displays. This decision affects data storage, API contracts, and downstream processing.
Should the ValidationPipe offer a built‑in flag to force UTC conversion of Date properties? If not, what pattern ensures uniform UTC dates while still allowing the original offset to be retained for logging? How can applications version‑gate this behavior when moving from NestJS 9 to NestJS 10?