|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Date and Time Calculation > DTO. - Date Time Operations > Date & Time Operations |
MiniRobotLanguage (MRL)
DTO.gmin Command
Get the numeric minute value from a time string
Intention
This command parses a time string, based on an optional format mask, and extracts the numeric value of the Minute component (0-59).
Syntax
DTO.gmin|TimeString|[FormatMask]|[$$RES]
DTO.getminute|...
Parameter Explanation
P1 - TimeString (Required)
The time string (or a variable, e.g., $$TIM) containing the time value.
Example: "14:30:45"
P2 - FormatMask (Optional)
The format mask string (or variable) describing the structure of P1.
Example: "HH:MM:SS". If omitted, a default mask (like "HH:MM:SS" with ':' separator, potentially including milliseconds) is assumed.
P3 - $$RES (Optional)
The variable (e.g., $$RES) where the numeric minute value (0-59) will be stored. If omitted, the result is placed on TOS.
Example
'**********************************************
' DTO.gmin - Sample
'**********************************************
'
' --- Example 1: Get minute (default mask) ---
$$TIM = "14:30:45"
DTO.gmin|$$TIM||$$MIN
DBV.Minute 1: $$MIN ' Result: 30
'
' --- Example 2: Get minute with specific mask (H.M.S) ---
$$TIM = "09.05.20"
$$MSK = "H.M.S"
DTO.gmin|$$TIM|$$MSK|$$MIN
DBV.Minute 2: $$MIN ' Result: 5
'
' --- Example 3: Get minute to TOS ---
DTO.gmin|"23:59:01"
POP.$$TOS
DBV.Minute 3: $$TOS ' Result: 59
'
ENR.
Remarks
This command uses the INT_ParseTimeComponents function internally to parse the time string.
If the time string does not contain a minute component according to the mask, or if parsing fails, the result will be 0.
Limitations
- Relies on the accuracy of the provided FormatMask (or the default) to correctly identify the minute component.
See also
• DTO.Get Time Milliseconds (gtms)