Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @DatabaseField(columnName="out_date",dataType=DataType.DATE_STRING,format="yyyy-MM-dd HH:mm:ss")
- private Date out_date;
- SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- outlet.setOut_date(formater.parse(json.getString("outletDate")));
- String date = "12/3/2014 12:00:00 AM";
- SimpleDateFormat sdf = new SimpleDateFormat("mm/dd/yyyy HH:MM:SS a");
- Date testDate = null;
- try {
- testDate = sdf.parse(date);
- }catch(Exception ex){
- ex.printStackTrace();
- }
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
- String newFormat = formatter.format(testDate);
- System.out.println(".....Date..."+newFormat);
- try {
- SimpleDateFormat sdf1 = new SimpleDateFormat("dd/mm/yyyy HH:mm:ss");
- Date date = sdf1.parse("12/3/2014 12:00:00 AM");
- String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
- System.out.println(format);
- }catch(Exception e){
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement