Node red - mysql

Good afternoon with everyone visiting here I have a query I have generated a code watching some tutorials on node red and mysql, communication has already been established and the data is inserted all right until there, the problem lies when I make the query and show it in a node table network in the date column shows me something more than the date and I don't know how to delete that or make a better capture I attach images


The data after the T should not appear since in the table they are not


The query to insert the data into the table

image
and the simple query for tarer the data of the table.

What is the column defined as in the database schema?
How are you inserting the field into the table?
Which node are you using to display the table?
What does the data look like coming out of the mysql node? (add a debug set to display the 'complete msg object')

Good evening zenofmud I attach the images according to the question, I hope the detail is indicated as I wrote it before, it is in the date column where I get more data of which it should not appear, that is seen in the object.

How is the column defined in the database schema?
image

How are you inserting the field into the table?
image

What node are you using to display the table?

How does the data coming out of the mysql node look like? (add a debug set to show the 'full message object')

What is Fecha defined as in the db?

1 Like

I suspect it is set to date type.

The issue is (probably), JavaScript does not have a date type, only a datetime so when the date is stored in a date type in the database, then returned in a SELECT query, it is set to a datetime & has a zero time.

The op should just ignore this and simply format the date as required when presenting it in a UI.

IMHO, the op should store the actual date AND time as one field in the database (not store the time separately) - then when preparing a UI, you simple take the date part and time part out of the datetime.

1 Like

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