Inserting date in Mysql

17 views
Skip to first unread message

mohamedamin...@esprit.tn

unread,
Apr 29, 2017, 9:02:03 AM4/29/17
to CodenameOne Discussions
Hello , 
I want to insert a Date object in mysql database , which has a Date type in the database as well , i am having problems inserting the date .
Here is what i wrote :

String s;
 s = date.getCurrentMonth() + "/" + date.getCurrentDay() + "/" + date.getCurrentYear();
 DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
 try {
     Date startDate = (Date) formatter.parse(s);
} catch (ParseException ex) {
 }

I'm getting 0 errors in the code.

Shai Almog

unread,
May 1, 2017, 1:15:31 AM5/1/17
to CodenameOne Discussions, mohamedamin...@esprit.tn
Reply all
Reply to author
Forward
0 new messages