Oracle® Fusion Middleware .NET API Reference for Oracle Coherence
12c (12.2.1.4.0)
E90869-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: 12.2.1.4014 (12.2.1.4014)

Syntax

C#
public static long ParseTime(
	string s,
	int defaultUnit
)

Parameters

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

Return Value

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