How to get date before one week from now in android in this format:
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ex: now 2010-09-19 HH:mm:ss, before one week 2010-09-12 HH:mm:ss
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Parse the date:
And then either figure out how many milliseconds you need to subtract:
Or use the API provided by the
java.util.Calendarclass:Then, if you need to, convert it back to a String: