我正在尝试显示此类数据
我正在以"2014-05-29T08:16:56Z"
格式接收数据,请告诉我如何执行此操作的代码。
答案 0 :(得分:0)
试试此代码,并查看:THIS
String oldFormat = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf1 = new SimpleDateFormat(oldFormat);
TimeZone obj = TimeZone.getTimeZone("CST");
sdf1.setTimeZone(obj);
Date date = sdf1.parse(" your match time ");
millis = date.getTime();
long currentTimeInMili = new Date().getTime(); // Current time
final CountDownTimer Counter1 = new CountDownTimer(millis - currentTimeInMili, 1 * 1000) {
public void onTick(long millisUntilFinished) {
matchUpcomingText.setText("" + formatTime(millisUntilFinished) + "till match start");
}
public void onFinish() {
matchUpcomingText.setText("Finished!");
}
}.start();