String to Date

Hi guys:

I have a button that set field value to localDateString. But when I open the database it doesnt recognize it as date but as string so if I want to run a query from date, doesnt work.

This is the code and the picture of the database. THANKS!

const today = new Date();
export function button_click(event) {
const options = {
weekday: “short” ,
day: “numeric” ,
month: “short” ,
year: 0
};

$w( "#dataset1" ).setFieldValue( "fechaConsulta" , today.toLocaleDateString( 'es-CO' , options)); 

$w( “#dataset1” ).save();

THE CODE WORKS FINE BUT…

HELP!

Dates in JavaScript are stored as Unix dates (milliseconds from 1/1/1970). There is no need to do all that formatting, that is for showing dates. If you just want to store a date, storing the value of “today” is all you need.

:nerd_face: THANKS!!!