【发布时间】:2015-02-05 18:02:07
【问题描述】:
我需要转换以下时间戳
String s = "08-12-2014 05:00:00"
to a readable format like "Today 5am"
请建议我如何做到这一点或我可以使用的库。
顺便说一句,我试过了
String ago = hourly.getHour(j).time() ;
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH);
Date d = inputFormat.parse(ago);
SimpleDateFormat outputFormat= new SimpleDateFormat("EEEE, MMMM dd, yyyy HH:mm a");
【问题讨论】:
标签: java android timestamp simpledateformat