ValidateDateTime
All validation programs
Validates any value or element against the specified date and time format.
Format of Parameters
Formatstring value
Where:
Formatstring
|
Format for date and time. This value can be an X12 or EDIFACT code (e.g., DT or 10) or a format you create using the allowable format strings. See information below for Allowable Format Strings, X12 Date/Time Codes, and EDIFACT Date/Time Codes. |
value
|
Value to be checked (constant, variable, internal keyword, etc.). |
Examples
Validate the value against EDIFACT Date Code 102:
ValidateDateTime "102" "20190111"
Validate the value against X12 Date Code D8:
ValidateDateTime "D8" "20190111"
Validate the value against the specified date format:
ValidateDateTime "CCYYMMDD" "20190111"
Validate the value against the specified date format:
ValidateDateTime "CCYYMMDD+" "20190111abc"
Allowable Format Strings
Format string can be made up of these character strings:
-
CC = Century
-
YY = Year
-
MM = Month (01-12)
-
DD = Day (01-31 depending on Month)
-
hh = Hour (00-23)
-
mm = Minute (00-59)
-
ss = second (00-59)
-
Trailing '+' = extra characters are accepted
X12 Date/Time Codes
D8 = CCYYMMDD
DT = CCYYMMDDHHMM
D6 = YYMMDD
DTS = CCYYMMDDHHMMSS
RD6 = YYMMDD-YYMMDD
RD8 = CCYYMMDD-CCYYMMDD
RDT = CCYYMMDDHHMM-CCYYMMDDHHMM
RTS = CCYYMMDDHHMMSS-CCYYMMDDHHMMSS
TM = HHMM
TS = HHMMSS
TSD = HHMMSSD
TSDD = HHMMSSDD
EDIFACT Date/Time Codes
2 = DDMMYY
3 = MMDDYY
4 = DDMMCCYY
5 = DDMMCCYYHHMM
10 = CCYYMMDDTHHMM
101 = YYMMDD
102 = CCYYMMDD
106 = MMDD
201 = YYMMDDHHMM
202 = YYMMDDHHMMSS
203 = CCYYMMDDHHMM
204 = CCYYMMDDHHMMSS
205 = CCYYMMDDHHMMZHHMM
401 = HHMM
402 = HHMMSS
713 = YYMMDDHHMMYYMMDDHHMM
717 = YYMMDDYYMMDD
718 = CCYYMMDDCCYYMMDD
719 = CCYYMMDDHHMMCCYYMMDDHHMM