I am currently pulling three form field inputs off the request object. The day, the month, and the year.
Day would be 11 for 11th day of the month
Month would be 12 for december
Year would be 2010 representing this year.
I need to convert this into a Java Date object, but since so much has been changed, I am not sure what the best way to store this in a java object. I need it in the format
YYYY-MM-DD HH:MM:SS
so I can compare to dates in the MySql Database.
SimpleDateFormat can convert strings to
java.util.Dateobjects.Dateclass has agetTime()method that yields the date in unix time format (number of milliseconds since January 1, 1970, 00:00:00 GMT).You can use
UNIX_TIMESTAMP()in MySQL to convert to unix time as well.