I am building an app that will convert swimming times from yards to meters, and can't figure out some important stuff.
I need a user to enter a time as this: minutes:seconds.hundredths
For example, if someone swam a 200 yard Freestyle in 1:52.43, I need to figure out how to multiply it by 1.11 a开发者_如何学运维nd add 3.2 seconds, then display it to the user as their converted time for a 50 meter length pool.
If your date format is like "2011-05-31 23:59:59";
SimpleDateFormat curFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
java.util.Date dateObj = null;
try {
dateObj = curFormater.parse(pDate);
millisecond = dateObj.getTime();
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
For more info for Date formatting refer http://developer.android.com/reference/java/text/SimpleDateFormat.html
http://download.oracle.com/javase/1.4.2/docs/api/java/text/SimpleDateFormat.html
http://developer.android.com/reference/java/text/SimpleDateFormat.html
精彩评论