Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
How to get selected date from JXDatePicker in yyyy-MM-dd format in JAVA?

What I have tried:

jXDatePicker1.getDate().toString("yyyy-MM-dd");
Posted
Updated 2-Apr-16 21:43pm

1 solution

Java
Date oDate = jXDatePicker1.getDate();        
DateFormat oDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String szDate = oDateFormat.format(oDate);

SimpleDateFormat (Java Platform SE 7 )[^]
 
Share this answer
 
Comments
Ma'd Saeed 3-Apr-16 14:13pm    
Ok, it worked.
but how can I insert it to Oracle Table in Date Column?
Kornfeld Eliyahu Peter 3-Apr-16 14:21pm    
You do not store in database date as formatted string, but as binary!!!
Ma'd Saeed 3-Apr-16 14:27pm    
How can I do that command, please?
Ma'd Saeed 3-Apr-16 14:28pm    
How can I Insert it as binary data?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900