I was wondering if java comes with a built in way to parse times/dates like this one:
5m1w5d3h10m15s
It’s 5 months, 1 week, 5 days, 3 hours, 10 minutes, 15 seconds.
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.
Yes, it’s called SimpleDateFormat, you just have to define your pattern.
As you didn’t (voluntarly?) precise the year, I added one :
Of course there are some libraries available (many people redirect to Joda, which is better than the standard and confusing java libraries) but as your question is about “if java comes with a built in way to parse times/dates”, the answer is a clear yes.