Date & Time Calculations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Date and Time Calculation >

Date & Time Calculations

VDF. - Verify Date Format

Previous Top Next


MiniRobotLanguage (MRL)

 

VDF. Command

Verify Date Format

 

 

Intention

 

What is a  date?

 

A date is this: "01.01.2010".  It can also be  "1.1.10".

A US-formatted Date like "2022/12/31" will be converted to the European Date that can be used with these functions here.

 

What does VDF do?

VDF. will check that you have to do with a valid date. For example:

"39.13.2013" looks like it would be would be the right date format.

But its not a valid date.

There are no 39 days in a month. And you can't have a 13 th month in a year.

Year-numbers can go from 100 to 9999. Years below 100 get a 2000 added.

If you specify "01.01.13" it will become "01.01.2013".

 

Let us see what VDF. will do in such a cases.

 

$$TIM=23/45/12

VDF.$$TIM

ITO.

 DBV.Timeout Flag: $$TIM

ELS.

 DBV.$$TIM  

EIF.

' Timeout Flag: 23-12-2012

 

As you can see here, in case that it did any changes in the supplied date, it will also set the "Timeout Flag". This way you know that VDF. has changed something in the date-format.

 

This does not necessarily mean that your date was wrong. It just means "it was changed". See this example::

 

$$TIM=01/01/2012

VDF.$$TIM

ITO.

 DBV.Timeout Flag: $$TIM

ELS.

 DBV.$$TIM  

EIF.

ENR.

 

VDF. does not really check, if your actual month has exactly a 31th day. It will generally check the date-range. It will check that any month will not have more the 31 days, and that any year will have 1 to 12 month.

 

 

If you just write VDF. you will get this output:on TOS:

 

00-00-0000

 

Which is the mask for the date. You can use this date immediately in DTC.

 

 

Syntax

 

VDF.P1[|P2]

 

 

Parameter Explanation

 

 

P1 - Variable or number that should be verified.

    If you specify an variable in P1, and P2 is omitted,

    then the result will be placed in that variable P1.

 

P2 -  (optional) If specified, this variable will be used for the

     resulting value.

 

 

 

Example

 

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

' VDF. - Sample

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

'

$$TIM=23/45/12

VDF.$$TIM

ITO.

 DBV.Timeout Flag: $$TIM

ELS.

 DBV.$$TIM  

EIF.

' Timeout Flag: 23-12-2012

ENR.

 

 

 

 

Remarks

 

Year-numbers can go from 100 to 9999. Years below 100 get a 2000 added.

If you specify "01.01.13" it will become "01.01.2013".

 

 

 

Limitations:

 

-

 

 

 

See also:

 

    1.5.1.3. Using Variables

    DAT. - Date and Time Information (System independent)

    VTF. - Verify Time Format

    TTV. - Time to Value

    DTV. - Date to Value

    VTD. - Value to Date

    DTC. - Date and Time Calculation

    IDC. / NDC. - If Date Command

    FMT. - Format Numeric Output

    CAL. - mathematical CALculation

    CAX. - Calculate Extended