前者转换没有问题,后者出现异常,请问大家有什么好办法解决吗?
解决方案 »
- 关于AlphaControls 控件
- delphi目前还有多少竞争力
- 如何获取 Microsoft Web Browser 控件里的网页内容?
- 寻找与ImageList类似控件
- Load from Structured Storage in memory without temporaray files on disk
- SOCKET发送一个包,要以16进制的1a作结尾,请教如何操作
- MDI主窗口中打开一个MDI子窗口时怎么把以前打开的MDI子窗口关闭
- 如何调用api函数??
- DateBaseDeskTop数据类型中的$(Money)能转换成Str或者Float吗?
- Delphi动态调用dll返回字符串为乱码
- 在ADOSTOREDPROC中切换两个SQL储存过程的小问题.
- RxRichedit取出图片和文字,并添加到另一个RxRichedt,并且格式不变
uses SysUtils;
#include <stdio.h>int main()
{
int a,b,c;
sscanf("2008-5-8","%d%*[-/]%d%*[-/]%d",&a,&b,&c);
printf("%d %d %d\n",a,b,c);
sscanf("2008/5/8","%d%*[-/]%d%*[-/]%d",&a,&b,&c);
printf("%d %d %d\n",a,b,c); return 0;
}
var d:TDateTime;
tmp:char;
begin
tmp :=DateSeparator;
DateSeparator :='/';
d := StrToDate('2007/12/31');
ShowMessage(DateToStr(d));
DateSeparator := tmp;
end;
AFromText, const AnsiString AToText);DescriptionCall AnsiReplaceStr to scan the string specified by AText and replace all occurrences of the string specified by AFromText with the string specified by AToText. Occurrences of AFromText are identified by a case-sensitive comparison. The identification of substrings is not recursive: if the substitution of AToText results in a new match for AFromText, that match is not replaced.
设置日期分割符,DateSeparator:='/';