# Date() or strtotime() Losing Day Value

**URL:** <https://www.phphelp.com/t/date-or-strtotime-losing-day-value/36680>\
**Category:** General PHP Help\
**Created:** [December 19, 2025, 11:04pm UTC](https://www.phphelp.com/t/date-or-strtotime-losing-day-value/36680 "2025-12-19T23:04:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PCHome](https://www.phphelp.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@PCHome](https://www.phphelp.com/u/PCHome)\
**Post date:** [December 19, 2025, 11:04pm UTC](https://www.phphelp.com/t/date-or-strtotime-losing-day-value/36680/1 "2025-12-19T23:04:16Z")

</div>

In a MySQL DATE column with the date formatted as 1954-06-15, `date('Y-m-d', strtotime($row))` returns 1954-06-01 every time. Am I missing something here?

---

<div class="post-metadata">

**Author:** ![phdr](https://www.phphelp.com/letter_avatar_proxy/v4/letter/p/91b2a8/32.png) [@phdr](https://www.phphelp.com/u/phdr)\
**Post date:** [December 20, 2025, 12:02am UTC](https://www.phphelp.com/t/date-or-strtotime-losing-day-value/36680/2 "2025-12-20T00:02:32Z")

</div>

Are you sure the variable with the value in it is $row? What does `var_dump($row);` show?

---

<div class="post-metadata">

**Author:** ![PCHome](https://www.phphelp.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@PCHome](https://www.phphelp.com/u/PCHome)\
**Post date:** [December 20, 2025, 12:13am UTC](https://www.phphelp.com/t/date-or-strtotime-losing-day-value/36680/3 "2025-12-20T00:13:12Z")

</div>

That’s a good question as I use a custom function for outputting anything to review which uses var\_dump but for some things it uses print\_r.

If I query the database using 1954-06-15 as the value in the query it pulls up the rows but you’re right, var\_dump it by itself outputs `June 1954`. I don’t see anything else that might be modifying it before it gets this far but apparently there is something I missed.

---

<div class="post-metadata">

**Author:** ![PCHome](https://www.phphelp.com/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@PCHome](https://www.phphelp.com/u/PCHome)\
**Post date:** [December 20, 2025, 12:23am UTC](https://www.phphelp.com/t/date-or-strtotime-losing-day-value/36680/4 "2025-12-20T00:23:18Z")

</div>

This is one of those Duh moments where the answer was right there! Nothing is changing it. The query that builds the array from which $row comes was formatting it before it even got to the PHP. Fix and now working. Thank you!
