MyChat Scripts: функція NoDate, значення "немає дати"
Отримати значення "немає дати та часу" (без корекції за UTC). У MyChat прийнято, що дата 1 січня 1900 вважається "початком відліку". Так звана константа "дата не вказана".
Синтаксис
function NoDate: double;
Результат функції
1 січня 1900, 0 годин, 0 хвилин, 0 секунд.
Приклад
function GetDateTimeAsText(dt: double): string;
begin
result := 'year: ' + FormatDateTime('yyyy', dt) + ', ' +
'month: ' + FormatDateTime('mm', dt) + ', ' +
'day: ' + FormatDateTime('dd', dt) + ', ' +
'time: ' + FormatDateTime('hh:nn:ss', dt);
end;
begin
mLogScript(GetDateTimeAsText(Now), 'Now');
mLogScript(GetDateTimeAsText(NoDate), 'NoDate constant');
end.
Результат роботи скрипту
[20:17:41] (Log "NoDate"): [Now] year: 2019, month: 10, day: 07, time: 20:17:41
[20:17:41] (Log "NoDate"): [NoDate constant] year: 1900, month: 01, day: 01, time: 00:00:00
[20:17:41] (Run "NoDate"): Час виконання скрипту: 4 мс
[20:17:41] (Run "NoDate"): Скрипт виконано успішно.