DIAdem Help

Content Type
Programming Language
Current manual

Function: TTR (Text to Real)

Function: TTR (Text to Real)

Converts a text in time format into a number in DIAdem double time format. The value depends on the variable ApplicationTimebaseHighResolution.

Use the command TTD instead of the TTR function in order to convert a text in time format into a VBS date.

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.
ReturnValue = TTR(String [,Format])

Input Parameters

StringSpecifies a text or a variable that contains the date in DIAdem time format. The text must not contain written or abbreviated weekdays, months, or calendar weeks. If the day or month is single-digit, it must contain leading zeros, for example, 01/02/2011.
[Format]Specifies the time format for the text according to the format instructions.
If you do not specify a time format, DIAdem applies the default format specified under Settings»DIAdem Settings.

Return Parameters

ReturnValueReturns a Double value.

The RTT function converts a number that exists in the DIAdem double time format into a text.

Examples

The following example converts a date into a number.

VBScriptPython

 

Dim dMyResult
dMyResult = TTR("09/11/1989","dd/mm/yyyy")

The following example determines the calendar week for the current date.

VBScriptPython

 

Dim strCurrWeek
strCurrWeek = Str(TTR(CurrDate),"#k")

Related Functions

Command: ChnConvertNumericToTime | Command: ChnConvertTimeToNumeric | Command: ConvertTimeType | Command: TTD | Command: TTD | Function: Char | Function: FCNo | Function: FileNameSplit | Function: Idx | Function: Len | Function: PU | Function: RTP (Real To Part of Date) | Function: RTT (Real to Text) | Function: Str | Function: Textaddition (+) | Function: Val

Was this information helpful?

Log in to get a better experience