Jiffy.parse constructor
Constructs a new Jiffy instance by parsing a String.
If pattern
is not provided, string
must be in one of the following
formats:
'1997-09-23'
'1997/09/23'
'1997-09-23 11:18:12.946621'
'1997-09-23T11:18:12.947031'
If pattern
is provided, string
should match the specified format.
Example usage:
final jiffy1 = Jiffy.parse('1997-09-23');
final jiffy2 = Jiffy.parse('1997 Sep 23th', pattern: 'yyyy MMM do');
Throws a JiffyException
if the input string
cannot be parsed.
Implementation
factory Jiffy.parse(String string, {String? pattern, bool isUtc = false}) {
return Jiffy._internal(string, pattern: pattern, isUtc: isUtc);
}