orders[index][6]=rs.getDate("dateArriving");
SimpleDateFormat formattedDate = new SimpleDateFormat("yyyy-MM-dd");
orderDate = formattedDate.parse(orderDateCon);
This is my line for getting the date and this is what i use to store the date:
so when i print orderDate, i get a result like this: Thu Nov 26 00:00:00 GMT 2015 I want the date to be printed so that the result is only Thu Nov 26 20125, without 00:00:00. +extra question, how to get the 00:00:00 to be stored in a normal way, because the time should be, for example, if the date is stored now, Thu Nov 26 22:14:50 GMT 2015
Explaining the question in more details:
....code....
String orderDateCon = menu.ordersList.get(y).getOrderDate().toString();
....code....
while(y < menu.ordersList.size())
{
formattedDate.format(formattedDate.parse(orderDateCon));
orderData[y][0] = (menu.ordersList.get(y).getProductName());
orderData[y][1] = (menu.ordersList.get(y).getQuantity());
orderData[y][2] = (menu.ordersList.get(y).getProductCost());
orderData[y][3] = (menu.ordersList.get(y).getTrademark());
orderData[y][4] = formattedDate.format(formattedDate.parse(orderDateCon));//(menu.ordersList.get(y).getOrderDate());
orderData[y][5] = (menu.ordersList.get(y).getArriveDate());
y++;
}
This code i use to store the data into a table, but this error i get: java.text.ParseException: Unparseable date: "Thu Nov 26 00:00:00 GMT 2015"