---
title: "Why Can a JavaScript Date-Only String Show the Previous Day?"  
description: "Why Can a JavaScript Date-Only String Show the Previous Day?"  
author: "Dmitry Belov"  
published: 2026-10-16  
canonical: https://answers.mindstick.com/qa/117704/why-can-a-javascript-date-only-string-show-the-previous-day  
category: "Mix Category"  
tags: ["javascript", "time zones", "Programming questions"]  
reading_time: 1 minute  

---

# Why Can a JavaScript Date-Only String Show the Previous Day?

I’m handling dates from a form, and a value such as `2026-03-08` can show up as the previous calendar day when I display it in my local timezone. I expected a date without a time to stay on the same date.

Here’s the kind of parsing I’m doing:

```js
const dateOnly = "2026-03-08"; // A date string with no time or timezone
const parsed = new Date(dateOnly); // Parse the string into a Date object
console.log(parsed.toString()); // Display the date using the local timezone
```

Is this a difference between a calendar date and a timestamp, or am I making an assumption about how JavaScript parses ISO date strings? I’d be interested in how others represent date-only values when they need to avoid timezone shifts.


---

Original Source: https://answers.mindstick.com/qa/117704/why-can-a-javascript-date-only-string-show-the-previous-day

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
