Delphi日期格式转换 str:=FormatDateTime('yyyy"-"mm"-"dd',Mydate); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 哪个地方不对?以下代码经过检验: Label1.Caption:=FormatDateTime('yyyy"-"mm"-"dd',DateTimePicker1.Date); 直接在主窗口OnCreate时间中添加如下代码: ShortDateFormat:=LongDateFormat;也可以设成另外的形式。 var lpstime: TSystemTime;begingetLocaltime(lpSTime);syearlabel.Caption :=inttostr(lpstime.wYear);smoulabel.Caption :=inttostr(lpstime.wMonth);sdaylabel.Caption :=inttostr(lpstime.wDay);shourlabel.Caption :=inttostr(lpstime.wHour);sminlabel.Caption :=inttostr(lpstime.wMinute);sseclabel.Caption :=inttostr(lpstime.wSecond);end;这里的wyear 本来就是4位的,何必那么麻烦呢。 我也来插一句:以下代码是从Help里抄来的:procedure TForm1.Button1Click(Sender: TObject);begin DateSeparator := '-'; DateFullYear := True; DateLeadZero := True; Label1.Caption := DateToStr(Date);end;可是实际运行的时候,编译却说DateSeparator DateFullYear DateLeadZero ‘undeclared’还要在前面声明什么吗? ACCESS语句转换成SQL SERVER语句 如何获得 当前有多少个用户读取局域网内的某个共享文件 ? 以及此时的网络流量..具体情况如下: 怎么让TMediaPlayer从特定的位置开始播放mp3文件? 数据库连接问题,请教高手! 关于Dbcombobox的问题 dbchart 为什么在运行时出现不了图形? 在线等待 请教一个有关OLE Automation Server封装Word操作的问题? 如何在菜单的左边加一个长方形的图片,就像WINDOWS的开始菜单? 我已经截获IP包 但是怎么知道他是发到哪个应用程序? 拿分啊 怎样去掉mdi主窗口的滚动条?
以下代码经过检验:
Label1.Caption:=FormatDateTime('yyyy"-"mm"-"dd',DateTimePicker1.Date);
ShortDateFormat:=LongDateFormat;
也可以设成另外的形式。
begin
getLocaltime(lpSTime);
syearlabel.Caption :=inttostr(lpstime.wYear);
smoulabel.Caption :=inttostr(lpstime.wMonth);
sdaylabel.Caption :=inttostr(lpstime.wDay);
shourlabel.Caption :=inttostr(lpstime.wHour);
sminlabel.Caption :=inttostr(lpstime.wMinute);
sseclabel.Caption :=inttostr(lpstime.wSecond);
end;这里的wyear 本来就是4位的,何必那么麻烦呢。
procedure TForm1.Button1Click(Sender: TObject);begin
DateSeparator := '-';
DateFullYear := True;
DateLeadZero := True;
Label1.Caption := DateToStr(Date);
end;
可是实际运行的时候,编译却说DateSeparator DateFullYear DateLeadZero ‘undeclared’还要在前面声明什么吗?