fCraft.DateTimeUtil.TryParseMiniTimeSpan C# (CSharp) Method

TryParseMiniTimeSpan() public static method

Attempts to parse the given string as a TimeSpan in compact representation. No exception is thrown if parsing failed.
text is null.
public static TryParseMiniTimeSpan ( [ text, System.TimeSpan &result ) : bool
text [ String to parse.
result System.TimeSpan Parsed TimeSpan. Set to TimeSpan.Zero if parsing failed.
return bool
        public static bool TryParseMiniTimeSpan( [NotNull] this string text, out TimeSpan result ) {
            if( text == null ) throw new ArgumentNullException( "text" );
            try {
                result = ParseMiniTimeSpan( text );
                return true;
            } catch( ArgumentException ) {
            } catch( OverflowException ) {
            } catch( FormatException ) { }
            result = TimeSpan.Zero;
            return false;
        }