DIAdem API Reference

Function: RTP (Real To Part of Date)

  • Updated2023-02-21
  • 3 minute(s) read

Converts a number in DIAdem double time format into a text in time format and determines from the calculated date partial date information based on the variable ApplicationTimebaseHighResolution.

ReturnValue = RTP(Value,Text)

Input Parameters

Value Specifies a numeric value, a variable, or a data channel containing the elapsed seconds. You can also specify a variant value with the subtype Date such as the functions CDate or Now return.
Note  If you save time values in DIAdem that are VBS VBDate subtype variables, the high resolution is lost. VBS only offers time values for this data type which provides only a limited resolution.
Text Specifies the wildcard of the time format for the date information you want to extract, such as the day or year.

Return Parameters

ReturnValueReturns the date information you want. The RTP function returns the result 0 for negative values.

Example

The following example converts the values of the Group1/Input data channel into time format, determines the months, and saves this result in the Group2/Result data channel.

VBScriptPython

 

Call Calculate ("Ch(""Group2/Result"")= RTP (Ch(""Group1/Input""), ""M"")")
Note  You must use the Calculate command in scripts to calculate data channels with formulas. Compute the data channels according to the syntax in the Calculator. Refer to the procedures Executing Channel Calculations in the Calculator and Assigning a Value to a Variable in the Calculator for more information about the Calculator.
The physical input quantity is arbitrary. The physical result quantity is dimensionless.
The Input and Result Quantities for Quantity-Based Calculations page contains an overview of the input quantities and result quantities of all functions. Refer to the Help page Calculating Quantity-Based and Non-Quantity-Based in DIAdem for the conditions and rules for quantity-based calculations.

Related Functions

Function: ^ | Function: Abs | Function: Ceil | Function: Deg | Function: Eex | Function: Exp | Function: Fak | Function: Floor | Function: Frac | Function: Lg | Function: Ln | Function: MaxV | Function: MinV | Function: Mod | Function: Rad | Function: Random | Function: Rnd | Function: Round | Function: RTT (Real to Text) | Function: Sign | Function: SND | Function: Sqr | Function: Sqrt | Function: Trunc | Function: VU