Var
s:string;
Begin
The FormatDateTime parameter 1 is a String format instruction, and parameter 2 is the Tdatetime type of time
S: = FormatDateTime (' C ', now); {back: 2007-12-18 23:56:05}
{instruction C indicates date and time in short format}
S: = FormatDateTime (' d ', now); {return: 19}
S: = FormatDateTime (' d ', strtodatetime (' 2008-1-1 ')); {return: 1}
{D represents date}
S: = FormatDateTime (' DD ', now); {return: 19}
S: = FormatDateTime (' dd ', strtodatetime (' 2008-1-1 ')); {return: 01}
{DD indicates double-digit date}
S: = FormatDateTime (' ddd ', now); {back: Wednesday}
S: = FormatDateTime (' dddd ', now); {back: Wednesday}
{DDD and dddd Express week; There may be differences in different languages}
S: = FormatDateTime (' ddddd ', now); {back: 2007-12-19}
{DDDDD Five d indicates short format date}
S: = FormatDateTime (' dddddd ', now); {back: December 19, 2007}
{DDDDDD Six d represents a long format date}
S: = FormatDateTime (' e ', now); {return: 7}
{e indicates year, 1-bit}
S: = FormatDateTime (' ee ', now); {return: 07}
{EE represents year, 2-bit}
S: = FormatDateTime (' eee ', now); {return: 2007}
S: = FormatDateTime (' eeee ', now); {return: 2007}
{EEE and eeee return 4-digit years}
S: = FormatDateTime (' m ', now); {return: 12}
{m represents month, 1-bit}
S: = FormatDateTime (' mm ', strtodatetime (' 2008-1-1 ')); {return: 01}
{mm for month, 2-bit}
S: = FormatDateTime (' mmm ', now); {back: December}
S: = FormatDateTime (' MMMM ', now); {back: December}
{MMM and mmmm represent long format months}
S: = FormatDateTime (' y ', now); {return: 07}
S: = FormatDateTime (' yy ', now); {return: 07}
S: = FormatDateTime (' yyy ', now); {return: 2007}
S: = FormatDateTime (' yyyy ', now); {return: 2007}
{y yy yyy yyyy indicates year; and e slightly different}
S: = FormatDateTime (' t ', now); {back: 0:21}
S: = FormatDateTime (' TT ', now); {back: 0:22:13}
{T TT represents time}
S: = FormatDateTime (' ampm ', now); {back: Morning}
S: = FormatDateTime (' tampm ', now); {back: 0:24 a.m.}
{ampm means morning, afternoon}
S: = FormatDateTime (' h ', Strtodatetime (' 2007-12-30 9:58:06 ')); {return: 9}
S: = FormatDateTime (' hh ', Strtodatetime (' 2007-12-30 9:58:06 ')); {return: 09}
{h HH indicated when}
S: = FormatDateTime (' n ', Strtodatetime (' 2007-12-30 9:58:06 ')); {return: 58}
S: = FormatDateTime (' nn ', Strtodatetime (' 2007-12-30 9:58:06 ')); {return: 58}
{n nn represents cent}
S: = FormatDateTime (' s ', Strtodatetime (' 2007-12-30 9:58:06 ')); {return: 6}
S: = FormatDateTime (' ss ', Strtodatetime (' 2007-12-30 9:58:06 ')); {return: 06}
{s SS represents seconds}
S: = FormatDateTime (' z ', now); {return: 24}
S: = FormatDateTime (' zz ', now); {return: 524}
S: = FormatDateTime (' zzz ', now); {return: 524}
{Z zz zzz represents milliseconds}
S: = FormatDateTime (' Yy\mm\dd ', now); {return: 07\12\19}
S: = FormatDateTime (' Yy/mm/dd ', now); {return: 07-12-19}
S: = FormatDateTime (' Yy-mm-dd ', now); {return: 07-12-19}
S: = FormatDateTime (' Yy*mm*dd ', now); {return: 07*12*19}
{Use separator,-is the default,/is equivalent to-if I have to use/display it?}
S: = FormatDateTime (' yy '/' mm '/' DD ', now); {return: 07/12/19}
S: = FormatDateTime (' "The Current time is:" Yyyy-m-d h:n:s:zz ", now);
{back: The current time is: 2007-12-19 0:47:16:576}
{The string you are mixing into is enclosed in double quotes}
ShowMessage (s);
End