MyChat Scripts: function DateTimeToMyChatStr, convert date/time into a text string of MyChat format
Convert date/time value (double) into a text string of MyChat format; the delimiter is dots: "day.month.year.hours.minutes.seconds".
Syntax
function DateTimeToMyChatStr(const dt: double): string;
Parameters and return values
Parameter |
Type |
Value |
dt |
double |
real number date and type. |
Function result
A text string in MyChat format that corresponds to transmitted date and time.
Example
var
dt: double;
begin
dt := Now;
mLogScript(DateTimeToMyChatStr(dt), 'Now');
dt := IncDay(dt, 1);
mLogScript(DateTimeToMyChatStr(dt), 'Tomorrow');
end.
Script work result
[12:28:13] (Log "DateTimeToMyChatStr"): [Now] 08.10.2019.12.28.13
[12:28:13] (Log "DateTimeToMyChatStr"): [Tomorrow] 09.10.2019.12.28.13
[12:28:13] (Run "DateTimeToMyChatStr"): Script operation time: 9 ms
[12:28:13] (Run "DateTimeToMyChatStr"): Script done successfully.