Back to project page libCalendar.
The source code is released under:
MIT License
If you think the Android project libCalendar listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.darkrockstudios.libs.calendar; // w w w. j ava 2 s . c om import java.util.regex.Matcher; import java.util.regex.Pattern; public class iCalUtility { public static long parseDuration( String icalDuration ) { final int GROUP_SECONDS = 1; final String PATTERN = "-?P(\\d)+S"; long durationInSeconds = -1; Pattern p = Pattern.compile( PATTERN ); Matcher m = p.matcher( icalDuration ); if( m.groupCount() > 1 ) { durationInSeconds = Long.parseLong( m.group( GROUP_SECONDS ) ); } return durationInSeconds; } }