Which date‑persisting convention should Backbone.js applications adopt for reliable regional time‑zone handling?
24K reputation · 21 Dec 2025, 20:45 UTC
Goal: achieve consistent date representation in Backbone.js models so that client‑side views display the correct local time while server APIs receive predictable values.
Constraints: Backbone.js has no date‑specific utilities; it treats a Date attribute as a plain JavaScript Date and its toJSON method converts it to an ISO‑8601 UTC string, which can drop the original time‑zone offset. Developers must therefore decide whether to persist dates as UTC strings or as local‑time strings, a choice that affects parsing, display formatting, and API contracts.
Should applications store model date attributes as UTC ISO strings to avoid offset loss during serialization? Alternatively, is it preferable to keep dates as local‑time strings and manually adjust before sending to the server?