Date & Time Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Date and Time Calculation > DTO. - Date Time Operations >

Date & Time Operations

DTO.Make Time Mask (mtm)

Previous Top Next


MiniRobotLanguage (MRL)

 

DTO.MakeTimeMask Command

Create a standard time format mask string

 

Intention

 

This command generates a standardized time format mask string, such as "HH:MM:SS" or "HH.MM.SS.ttt". You can specify the separator character and whether to include milliseconds.

This is useful for creating consistent format strings to be used with other DTO commands like DTO.fmt, DTO.ptime, or DTO.reft.

 

The generated mask uses these components:

  HH: 2-digit hour (00-23)

  MM: 2-digit minute (00-59)

  SS: 2-digit second (00-59)

  ttt: 3-digit milliseconds (000-999) - Optional

 

Syntax

 

DTO.maketimemask|[Separator][|IncludeMS][|$$RES]

DTO.mtm|[Separator][|IncludeMS][|$$RES]

 

Parameter Explanation

 

P1 - Separator (Optional)

A string containing the character to use as a separator between time components (e.g., ":", ".", "-"). Only the first character is used. If omitted, ":" is used as the default.

 

P2 - IncludeMS (Optional)

A numeric flag (or variable). If the value is 1, the milliseconds component ("ttt") is included in the mask. Otherwise (or if omitted), it's excluded. Defaults to 0.

 

P3 - $$RES (Optional)

The variable (e.g., $$RES) where the generated mask string will be stored. If omitted, the result is placed on TOS.

 

 

Example

 

'**********************************************

' DTO.mtm - Sample

'**********************************************

'

' --- Example 1: Default mask (HH:MM:SS) ---

DTO.mtm|||$$MSK1

DBV.Default Mask: $$MSK1 ' Result: "HH:MM:SS"

'

' --- Example 2: Mask with "." separator ---

DTO.mtm|"."||$$MSK2

DBV.Dot Separator: $$MSK2 ' Result: "HH.MM.SS"

'

' --- Example 3: Default separator with milliseconds ---

DTO.mtm||1|$$MSK3

DBV.With MS: $$MSK3 ' Result: "HH:MM:SS:ttt"

'

' --- Example 4: "-" separator with milliseconds, result to TOS ---

DTO.mtm|"-"|1

POP.$$TOS

DBV.Dash & MS (TOS): $$TOS ' Result: "HH-MM-SS-ttt"

'

ENR.

 

Remarks

 

This command always uses 2-digit placeholders (HH, MM, SS) and 3-digit for milliseconds (ttt).

The generated mask ensures consistency when formatting or parsing time values.

 

Limitations

 

- Only supports the standard HH, MM, SS, ttt components.

- Does not create masks for 12-hour format (AM/PM).

 

See also

 

    DTO. - Date Time Operations

    DTO.Make Date Mask - create date format mask

    DTO.Format Time - format time components to string

    DTO.Parse Time - parse time into components

    DTO.Reformat Time - reformat time using mask