Click or drag to resize

SessionToFormattedTimeSpan Method

Format a TimeSpan value per the current DateCulture and/or NumberCulture culture. Examples: "3h 12m 2s", "18.7 years", "17 days, 3h 21m". Note: At this time the generated string is not fully localized.

The following formatting characters are supported and may be combined:

  • d - Include the date portion of the span (but only if days > 0).
  • D - Include the date portion of the span (even when zero days).
  • t - Include the time portion of the span.
  • s - Include seconds if time is included in format.

Namespace:  NetQuarry
Assembly:  EAP.Core (in EAP.Core.dll) Version: 2.0.0.0 (4.6.8.0)
Syntax
public string ToFormattedTimeSpan(
	TimeSpan span,
	string format
)

Parameters

span
Type: SystemTimeSpan
The time span to format.
format
Type: SystemString
The format to use from the list above.

Return Value

Type: String
The formatted value as a string.
See Also