|
<< Click to Display Table of Contents >> Navigation: 3. Script Language > Date and Time Calculation > DTO. - Date Time Operations > Date & Time Operations |
MiniRobotLanguage (MRL)
DTO.MakeDateMask Command
Create a standard date format mask
Intention
This command generates a standard date format mask string in the format "DD<sep>MM<sep>YYYY", using a specified separator character. If no separator is provided, a dot (.) is used as the default.
This is useful for creating consistent format masks to be used with other DTO commands like DTO.FormatDate or DTO.ParseDate.
The generated mask uses:
• DD: 2-digit day
• MM: 2-digit month
• YYYY: 4-digit year
Syntax
DTO.makedatemask|[Separator][|$$RES]
DTO.mdm|[Separator][|$$RES]
Parameter Explanation
P1 - Separator (Optional)
The single character to use as a separator between date components (e.g., ".", "-", "/"). If omitted or empty, "." is used.
P2 - $$RES (Optional)
The variable (e.g., $$RES) where the resulting format mask string will be stored. If omitted, the result is placed on TOS.
Example
'**********************************************
' DTO.mdm - Sample
'**********************************************
'
' --- Get default mask (DD.MM.YYYY) ---
DTO.mdm||$$MSK1
DBV.Default Mask: $$MSK1 ' Result: "DD.MM.YYYY"
'
' --- Create mask with hyphen separator ---
DTO.mdm|"-"|$$MSK2
DBV.Hyphen Mask: $$MSK2 ' Result: "DD-MM-YYYY"
'
' --- Create mask with slash separator (Result to TOS) ---
DTO.mdm|"/"
POP.$$MSK3
DBV.Slash Mask: $$MSK3 ' Result: "DD/MM/YYYY"
'
ENR.
Remarks
The generated mask always uses the format "DD<sep>MM<sep>YYYY". If you need other formats (e.g., "MM/DD/YYYY" or "YYYY-MM-DD"), you must construct the mask string manually.
If the provided separator string contains multiple characters, only the first character is used.
Limitations
- Only generates the "DD<sep>MM<sep>YYYY" format.
See also
• DTO.Make Time Mask - create time format mask
• DTO.Format Date - format date components to string
• DTO.Parse Date - parse date into components
• DTO.Get Date Separator - detect date separator char