Here you can find the source of getExpireTime(String timeStr)
private static Date getExpireTime(String timeStr)
//package com.java2s; //License from project: Open Source License import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Date; public class Main { private static final String dateFormat = "yyyy-MM-dd HH:mm:ss"; private static Date getExpireTime(String timeStr) { SimpleDateFormat formatter = new SimpleDateFormat(dateFormat); Date date = formatter.parse(timeStr, new ParsePosition(0)); return date; }//from w w w . j a va 2 s .c o m }