SQL accept date format: yyyy-mm-dd
But java data format is, mm-dd-yyyy by default. I believe that is what causing the problem. you can change the date format for java, and fix the date format to yyyy-mm-dd and i think everything will be fine.
here is some code, that might help:
use these imports:
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
then, the code goes something like....
Date dst = new Date();
SimpleDateFormat yourDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
st = yourDate.format(dst);
Edited on, October 14, 2005, 6:56 PM GMT, by Rubu.
|