function ShortDate:string;
var s : array[0..255]of char;
begin
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, nil, nil, s, SizeOf(s));
Result:=s;
end;function LongDate:string;
var s : array[0..255]of char;
begin
GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, nil, nil, s, SizeOf(s));
Result:=s;
end;
var s : array[0..255]of char;
begin
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, nil, nil, s, SizeOf(s));
Result:=s;
end;function LongDate:string;
var s : array[0..255]of char;
begin
GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, nil, nil, s, SizeOf(s));
Result:=s;
end;
var s : array[0..255]of char;
begin
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, nil, nil, s, SizeOf(s));
Result:=s;
end;function LongDate:string;
var s : array[0..255]of char;
begin
GetDateFormat(LOCALE_USER_DEFAULT, DATE_LONGDATE, nil, nil, s, SizeOf(s));
Result:=s;
end;
Label1.Caption := DateTimeToStr(Now);end;
edit1.text := DateTimetoStr(Now);end;
lp:string;
begin
getsystemgime(lp);
edit1.text:=inttostr(lp.wyear); //获得年
edit2.text:=inttostr(lp.wmonth);//获得月
eidt3.text:=inttostr(lp.wdat); //获得天数依此类推,可以得时间,到秒
begin
Self.Caption := 'Today is ' + DateToStr(Date);
end;