parseDurationNanosQuiet

parseDurationNanosQuiet converts a string representing a period or Duration to nanoseconds. Time duration strings can be formatted as [-]PT[-]hh:mm:[ss.nnnnnnnnn] or as a duration string formatted as [-]PnDTnHnMn.nS.

"Quiet" methods return null instead of throwing an exception when encountering a string that cannot be parsed.

Syntax

Parameters

ParameterTypeDescription
sstring

The string to be converted.

Time duration strings can be formatted as [-]PT[-]hh:mm:[ss.nnnnnnnnn] or as a duration string formatted as [-]PnDTnHnMn.nS.

Returns

Nanoseconds representation of the time string, or null if invalid input is given.

Examples