How to store a date and time with JCalendar and send it to a database with datetime field?
How to store a date and time with JCalendar and send it to a database with datetime field?
Working with JDateChooser
int año = jdt.getCalendar().get(Calendar.YEAR);
int mes = jdt.getCalendar().get(Calendar.MARCH);
int dia = jdt.getCalendar().get(Calendar.DAY_OF_MONTH);
fecha =(año+"-"+mes+"-"+dia);
jdt
is the name of the JDateChooser ...
When you save a date type the documentation says AÑO-MES-DIA
that's why fecha
is that way, then fecha
you spend it by INSERT INTO
likewise another variable where it corresponds.