tDate | (Date) variable of the Date type (it holds the date and time) |
---|---|
vFormat | (Variant) Type of the pre-defined conversion or formatting rule for the date and time conversion into the string. If the vFormat is of a numeric type, then the number is understood as the type of the pre-defined conversion.
1 - The internal way of date and time storing in the PROMOTIC system is in the form: 2024.10.23 15:23:28.082. This way ensures that the strings are sorted in compliance with the date and time sorting.
2 - Creates the time in the Internet format: Tue, 04 Jan 2024 15:23:28 GMT.
String type - If vFormat is of the String type, then it is the formatting rule for the time conversion into the string.
Example: "%d.%m.%Y_%H:%M:%S.%T", where: d=day (01-31),
m=month (01-12),
Y=year (e.g. 2024),
H=hour (00-23),
M=minute (00-59),
S=second (00-59),
T=millisecond (000-999) - it is possible %nT, where n is count of digits 1, 2 or 3
Any of the chars %d, %m, %Y, %M, ... can be omitted and so to omit the corresponding time item in the presentation. 20 - Obsolete. Creates the time in the form suitable for the MS SQL database: '2024-10-23 15:23:28.082'.
It is better to use string type with the value: '%Y-%m-%d %H:%M:%S.%T'. 21 - Obsolete. Creates the time in the form suitable for the Oracle database: TIMESTAMP'2024-10-23 15:23:28.082'.
It is better to use string type with the value: TIMESTAMP'%Y-%m-%d %H:%M:%S.%T'. 22 - Obsolete. Creates the time in the form suitable for the MySQL database: '2024-10-23 15:23:28'.
It is better to use string type with the value: '%Y-%m-%d %H:%M:%S'. 23 - Obsolete. Creates the time in the form suitable for the Microsoft Access, dBase, PARADOX databases on setting the direct access: #10 23 2024 15:23:28#.
It is better to use string type with the value: #%m %d %Y %H:%M:%S#. |
var tDate = Pm.Time;
var sDate = Pm.FormatDate(tDate, "%d.%m.%Y_%H:%M:%S");
// sDate contains for example "24.07.2024_17:06:35"
var tDate = Pm.Time;
var sDate = Pm.FormatDate(tDate, "%d.%m.%Y_%H:%M:%S.%2T");
// sDate contains for example "24.07.2024_17:06:35.63"