ScanDate - method of object Pm

Obtains date and time from text value according to the formatting rule.
ScanDate(sDate As String, nFormatType As Integer, [sFormatValue As String]) As Date
t = Pm.ScanDate(sDate, nFormatType, sFormatValue)
sDate(String) Variable of the String type (date and time)
nFormatType(Integer) Type of date and time format.
1 - Date and time storage for example in the form: 2018.10.11 15:23:28.082. Only the order is important. Except for the year the sDate may contain no other data. Any separators may be used (the same way as ScanDate(10, "YomdHMST")).

sFormatValue is not used.

10 - Date and time is stored in sDate as a set of numbers (separated by any character except for numbers).

The sFormatValue contains the order and description of meanings of those numbers.

sFormatValue[optional] (String) Additional information regarding date and time format.
- For nFormatType = 1:

is not used. Don't set.

- For nFormatType = 10:

The order of date/time items in sDate is specified here.

For example: "YmdoHMST", where:

Y=year (e.g. 2018)
m=month (01-12)
d=day (01-31)
H=hour (00-23)
M=minute (00-59)
S=second (00-59)
T=millisecond (000-999)
o=optional: From this item on all other items are optional. For example year, month and day must be defined in sDate but other are optional.

The items may be entered in arbitrary order and in sDate can be separated by any characters except for numbers.

The items may not be separated by any characters (e.g. "20181011152328082"). If so then:

- year there must be 4 digits
- month, day, hour, minute, second there must be 2 digits
- millisecond there must be 3 digits
The method can also be called in the graphic item events for Web panels.
JavaScriptVBScriptSelect and copy to clipboard

var sDate = "2018.10.11 15:23:28.082";
var tDate = Pm.ScanDate(sDate, 1);
PROMOTIC 8.3.30 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- Pm
- Abs
- Cos
- E
- Exp
- LN2
- PI
- Pow
- ScanDate
- Sin
- Tan
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice