JavaScript method: SCDatum.setType()

This method sets the data type of HPE Service Manager datum objects. The SCDatum object also automatically converts Service Manager data types into corresponding JavaScript data types. You can also use the XMLDate object and its methods to convert between date/time formats.

Syntax

SCDatum_object.setType( dataType );

Arguments

The following arguments are valid for this method:

Argument Data type Description
dataType Number This argument specifies the Service Manager data type for the object. See Data types.

Return values

None

Example

This example does the following:

  • Creates an SCDatum object containing the number of milliseconds you want to convert
  • Sets the data type of the SCDatum object to a Service Manager date/time type
  • Converts the number of milliseconds into a JavaScript date/time

This example requires the following sample data:

  • A number of milliseconds (for example, "1234567890")
var millisecs;

function findDateTime( num )
{
 var t = new SCDatum( num );
 t.setType( 3 );
 print( num + " milliseconds is equal to the date: " + t.JSDate() );
}

millisecs = 1234567890;
findDateTime( millisecs );