如何设置和获取当前系统的时间格式? 我像通过程序自己去获得系统的时间格式是YYYY-MM-DD还是YYYY/MM/DD等其他的格式,并且将系统的时间格式设置为“YYYY-MM-DD”,我知道可以到控制面板里手动设置,但我想用程序来实现这一过程。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit setsysdate;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Edit1: TEdit; Edit2: TEdit; Label1: TLabel; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } function GetsysDateFormat: string; procedure SetSysDateFormat(s: string); public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}function Tform1.GetsysDateFormat: string;varsgs:string;beginsetlength(sgs,12);GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SSHORTDATE ,PChar(sgs),12);result:=string(pchar(sgs));end;procedure Tform1.SetSysDateFormat(s: string);beginSetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SSHORTDATE,PChar(s));end;procedure TForm1.Button1Click(Sender: TObject);begin edit1.text:=GetsysDateFormat;end;procedure TForm1.Button2Click(Sender: TObject);beginSetSysDateFormat(edit2.Text);end;end. Xp下编译的多线程程序在win7 32位下无法开启多线程, 【100分】ClientSocket重新连接问题 关于工具栏的问题? 横向预览的问题,可以解决吗? StringGrid的问题,UP有分~ 请教高手 VB里面的MSFlexGrid控件在delphi6,7里面怎么用的。我出200分 ★★★★ 帮帮我 ★★★★ 高手们,如何将.mod文件恢复成SQL SERVER数据库啊?200分送上。 关于数据庫的一个问题 急死啦!为什么总是需要先登录一次服务器后才能连接到SQL Server? ActiveX WindowsMediaPlayer运行时调整大小的问题
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
function GetsysDateFormat: string;
procedure SetSysDateFormat(s: string);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}function Tform1.GetsysDateFormat: string;
var
sgs:string;
begin
setlength(sgs,12);
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SSHORTDATE ,PChar(sgs),12);
result:=string(pchar(sgs));
end;
procedure Tform1.SetSysDateFormat(s: string);
begin
SetLocaleInfo(LOCALE_SYSTEM_DEFAULT,LOCALE_SSHORTDATE,PChar(s));
end;procedure TForm1.Button1Click(Sender: TObject);
begin
edit1.text:=GetsysDateFormat;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
SetSysDateFormat(edit2.Text);
end;end.