# Mysql node returns time and date from columns set as DATE

**URL:** <https://discourse.nodered.org/t/mysql-node-returns-time-and-date-from-columns-set-as-date/86885>\
**Category:** General\
**Created:** [31 March 2024 14:54 UTC](https://discourse.nodered.org/t/mysql-node-returns-time-and-date-from-columns-set-as-date/86885 "2024-03-31T14:54:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![essereumano](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/essereumano/32/48262_2.png) [@essereumano](https://discourse.nodered.org/u/essereumano)\
**Post date:** [31 March 2024 14:54 UTC](https://discourse.nodered.org/t/mysql-node-returns-time-and-date-from-columns-set-as-date/86885/1 "2024-03-31T14:54:27Z")

</div>

Hi everyone, when I perform a SELECT type qwery through the mysql node in the DATE type columns I receive both time and date, but if I do the same qwery through a Visualdb type client I correctly only receive the date. Is this a bug or am I doing something wrong?  
Node red:3.1.8  
node-red-node-mysql 2.0  
database Mariadb: 1:11.3.2+maria~ubu2204  
All used by container

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [31 March 2024 16:06 UTC](https://discourse.nodered.org/t/mysql-node-returns-time-and-date-from-columns-set-as-date/86885/2 "2024-03-31T16:06:23Z")

</div>

Probably not. JS (currently) has no concept of _just a date_ - there is the `Date` Object that is the time in milliseconds that has elapsed since the [epoch](https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-time-values-and-time-range), which is defined as the midnight at the beginning of January 1, 1970, UTC.

But there is no reason you cannot use that in your flows. For example the change node has `moment` that can convert it to a date string. or you can use a function node to call the various `Date.toXxxxx()` functions.

The question is really, what are you wishing to do with the date you get from the database? If you wish to show it on a dashboard or pass it somewhere else, then it is probably just a matter of formatting it as you wish.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 April 2024 16:06 UTC](https://discourse.nodered.org/t/mysql-node-returns-time-and-date-from-columns-set-as-date/86885/3 "2024-04-14T16:06:56Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
