TimeSpan.FromUnits(Variable, String) Method

Top 

Description

Creates a TimeSpan from a value with the specified units.

 

Timing Precision Mode

This page describes functionality in nanosecond timing precision mode.

 

Method Signature

TimeSpan.FromUnits(

Variable value,


String units)

 

 

Arguments

value


Description:

The length of time in the specified units.

Units:

s

 

 

units


Description:

The units with which the value will be interpreted.

Valid Values:

Value

Label

"day"

days

"hr"

hours

"min"

minutes

"s"

seconds

 

 

 

 

Return Value

Type:

timespan

Units:

day

 

 

Returns a TimeSpan representing the specified length of time with the specified units.

 

Syntax

myTimeSpan1 = TimeSpan.FromUnits(myVariable1, myString1);

 

 

See also

TimeSpan Object

TimeSpans Guide

Parsing Dates and Times