Split date/time strings

后端 未结 7 1883
不思量自难忘°
不思量自难忘° 2020-12-18 03:32

I have a ReST service which downloads information about events in a persons calendar...

When it returns the date and time, it returns them as a string

e.g. d

7条回答
  •  难免孤独
    2020-12-18 03:57

    This is just a Idea, you can do some thing like this without splitting

        DateFormat formatter = new SimpleDateFormat("MM/dd/yyyy HH:mm a");
        Date date = formatter.parse("12/8/2012 11:25 am");      
        Calendar cal=Calendar.getInstance();
        cal.setTime(date);
    

提交回复
热议问题