DAT. - Date and Time Information (System independent)

<< Click to Display Table of Contents >>

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

DAT. - Date and Time Information (System independent)

DAT. - Date to Value

Previous Top Next


MiniRobotLanguage (MRL)

 

DAT. Command

Date and Time Informations

 

 

Intention

 

This command returns date and time information.

 

Most of them are system-independent. No matter in which country the script will run, you will get exactly the same formatted time/date information.

 

There are several different Information you can retrieve using DAT.

 

For this you call the DAT.-command and specify an number from 0 to 10.

Here is a list of the numbers, and what they return.

 

DAT.0 ->Samstag<-

DAT.1 ->Februar<-

DAT.2 ->25<-

DAT.3 ->2012<-

DAT.4 ->11:28:16<-

DAT.5 ->11:28:16:406<-

DAT.6 ->6<- (DAY-Nr. of the WEEK)

DAT.7 ->25.02.2012<-

DAT.8 ->Saturday<- (DAYNAME)

DAT.9 ->SA<-     (DAYNAME-2 Letter)

DAT.10 -> 11:28<- (hh::MM)

DAT.11 ->2<-    (Month number)

DAT.12 ->02<-    (Month number with "0"-Prefix Format)

DAT.13 ->2020_12_01<-    (YYYY_MM_DD)

DAT.14 ->2020.12.01<-    (YYYY.MM.DD)

DAT.15 ->2020-12-01<-    (YYYY-MM-DD)

DAT.16 ->01_12_2020<-    (DD_MM_YYYY)

DAT.17 ->01122020<-    (DDMMYYYY)

DAT.18 ->20201201<-    (YYYYMMDD)

DAT.19 ->01<-    (DD)

 

 

For example:

 

DAT.10|$$RES

DBV.$$RES

ENR.

 

You can also use the same variable for source and target:

 

$$RES=10

DAT.$$RES

DBV.$$RES

ENR.

 

 

Syntax

 

DAT.[P1][|P2]

 

 

 

 

Parameter Explanation

 

 

P1 - (optional) If omitted or empty, the

    actual time is returned. The result will be placed on

    the TOS. If you specify an variable in P1, and P2 is

    omitted, then the result will be placed in that variable P1.

 

These are the numbers you can specify as P1, and what they return:

 

' Returns the Dayname in computer local language

DAT.0 ->Samstag<-

 

' Returns the  Monthname in computer local language

DAT.1 ->Februar<-

 

' Returns the Daynumber in the month

DAT.2 ->25<-

 

' Returns the actual year

DAT.3 ->2012<-

 

' Returns the actual time in fixed format.

DAT.4 ->11:28:16<-

 

' Returns the actual time in fixed format incl. ms.

DAT.5 ->11:28:16:406<-

 

' Returns the day of the week, numeric

DAT.6 ->6<-

 

' Returns the actual date in fixed format

DAT.7 ->25.02.2012<-

 

' Returns todays day in english

DAT.8 ->Saturday<-

 

' Returns first two letters of todays day (engl.)

DAT.9 ->SA<-

 

' Returns how many days this actual month has

DAT.10->11:28<-

 

' Returns the Month-Number

DAT.11 ->2<-    (Month number)

 

' Returns the Month number in 2-Prefix "00"

DAT.12 ->02<-    (Month number with "0"-Prefix Format)

 

' Returns the Date (YYYY_MM_DD)

DAT.13 ->2020_12_01<-    

 

' Returns the Date  (YYYY.MM.DD)

DAT.14 ->2020.12.01<-    

 

' Returns the Date   (YYYY-MM-DD)

DAT.15 ->2020-12-01<-  

 

' Returns the Date  (DD_MM_YYYY)

DAT.16 ->01_12_2020<-    

 

' Returns the Date (DDMMYYYY)

DAT.17 ->01122020<-    

 

' Returns the Date  (YYYYMMDD)

DAT.18 ->20201201<-    

 

' Returns the Day-number in Month in "00"-Format

DAT.19 ->01<-    (DD)

 

 

 

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

     resulting value. If omitted, and P1 is a variable, P1 will

      be used. Else the result will be placed on TOS.

 

 

 

Example

 

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

' DAT. - Sample

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

'

FOR.$$CNT|0|10

 DAT.$$CNT|$$RES

 DBP.DAT.$$CNT->$$RES<-

NEX.

ENR.

DAT.10

DBV.$$000

ENR.

 

 

 

 

Remarks

 

-

 

 

 

Limitations:

 

All Date-calculations should be accurate up to a Millisecond at least back until 1601.

 

 

 

See also:

 

    1.5.1.3. Using Variables

    VTT. - Value to Time

    TTV. - Time to Value

    VTD. - Value to Date

    DTC. - Date and Time Calculation

    VTF. - Verify Time Format

    VDF. - Verify Date Format

    IDC. / NDC. - If Date Command

    CAL. - mathematical CALculation

    CAX. - Calculate Extended