Click or drag to resize

XmlHelperParseTime Method (String, Int32)

Oracle® Fusion Middleware .NET API Reference for Oracle Coherence
14c (14.1.1.0)
F23534-02
Parse the given string representation of a time duration and return its value as a number of milliseconds.

Namespace:  Tangosol.Run.Xml
Assembly:  Coherence (in Coherence.dll) Version: 14.1.1.14 (14.1.1.14)
Syntax
C#
public static long ParseTime(
	string s,
	int defaultUnit
)

Parameters

s
Type: SystemString
A string with the format [\d]+[[.][\d]+]?[MS|ms|S|s|M|m|H|h|D|d]?
defaultUnit
Type: SystemInt32
The unit to use in the conversion to milliseconds if one is not specified in the supplied string.

Return Value

Type: Int64
The number of milliseconds represented by the given string.
Remarks
The supplied string must be in the format:

[\d]+[[.][\d]+]?[MS|ms|S|s|M|m|H|h|D|d]?

where the first non-digits (from left to right) indicate the unit of time duration:

  • MS or ms (milliseconds)
  • S or s (seconds)
  • M or m (minutes)
  • H or h (hours)
  • D or d (days)

If the string value does not contain a unit, the specified default unit is assumed. The default unit can be one of:

See Also