"For developers", "Server scripts", "Functions description", "Converting types", "StrMyChatToDateTime".
Convert MyChat text string (dd.mm.yyyy.hh.nn.ss) into the number with the floating point of double format.
function StrMyChatToDateTime(const sDate: string): double;
Parameter |
Type |
Value |
sDate |
string |
date/time text representation in MyChat format. |
The number in double format. If you send an empty or incorrect string, the function returns NODATE-value.
const
MYCHAT_BIRTHDAY = '13.05.2004.03.14.15';
var
dt: double;
begin
dt := StrMyChatToDateTime(MYCHAT_BIRTHDAY);
mLogScript(FormatDateTime('d (ddd) mmm yyyy hh:nn:ss', dt), '');
end.
[12:48:11] (Log "StrMyChatToDateTime"): 13 (Th) May 2004 03:14:15
[12:48:11] (Run "StrMyChatToDateTime"): Script operation time: 7 ms
[12:48:11] (Run "StrMyChatToDateTime"): Script done successfully.