这个日期格式该怎么处理20080917T10:20:21000 20080917T10:20:21000是台湾一个oracle db中的date字段的值。在delphi,无法使用datetimetostr等函数转换。在delphi中,我如何正确读取oracle中该列的值,并转换成正确的datetime类型 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 20080917T10:20:21000分解一下,应该是2008年09月17日10点20分21秒因为字符串比较规整,所以你可以采取读取字符串方法进行copy(str,1,4)为年copy(str,5,2)为月copy(str,7,2)为日copy(str,10,2)为秒copy(str,13,2);为分copy(str,16,2);为秒下面的事情想你应该知道怎么做了 var strTemp:string; dtTemp:TDateTime;begin strTemp:='20080917T10:20:21000'; strTemp:=StringReplace(strTemp,'T',' ',[rfReplaceAll]); strTemp:=LeftStr(strTemp,Length(strTemp)-3); Insert('-',strTemp,7); Insert('-',strTemp,5); dtTemp:=StrToDateTime(strTemp); var strTemp:string; dtTemp:TDateTime;begin strTemp:='20080917T10:20:21000'; strTemp:=StringReplace(strTemp,'T',' ',[rfReplaceAll]); strTemp:=LeftStr(strTemp,Length(strTemp)-3); Insert('-',strTemp,7); Insert('-',strTemp,5); dtTemp:=StrToDateTime(strTemp);具体问题具体分析 这个应该满足楼主需要了http://harryfin.spaces.live.com/Blog/cns!31E57C5D97ECDF5!409.entry?wa=wsignin1.0 【求拯救】Delphi写的DLL,C++Builder调用,结果不正确, delphi定时执行SQL sql查询问题 一张病历单怎么写成表比较好?? SQL语句问题,给看看啊????????????? 怎样取得当前日期的后一天啊? 数据库与StringGrid的问题 急!急!急! 关于连接远程服务器的问题!很急! 我用以下SQL语句从一个表中查找出来一些数据,想将这些数据添加到另一个表中,应该怎样写SQL? 关于fastreport2.4的一个小问题,在线等,, Datasource 如何才可以用字符串宏替换 求助,关于短信群发!短信发不出去!
分解一下,应该是
2008年09月17日10点20分21秒
因为字符串比较规整,所以你可以采取读取字符串方法进行
copy(str,1,4)为年
copy(str,5,2)为月
copy(str,7,2)为日
copy(str,10,2)为秒
copy(str,13,2);为分
copy(str,16,2);为秒
下面的事情想你应该知道怎么做了
strTemp:string;
dtTemp:TDateTime;
begin
strTemp:='20080917T10:20:21000';
strTemp:=StringReplace(strTemp,'T',' ',[rfReplaceAll]);
strTemp:=LeftStr(strTemp,Length(strTemp)-3);
Insert('-',strTemp,7);
Insert('-',strTemp,5);
dtTemp:=StrToDateTime(strTemp);
strTemp:string;
dtTemp:TDateTime;
begin
strTemp:='20080917T10:20:21000';
strTemp:=StringReplace(strTemp,'T',' ',[rfReplaceAll]);
strTemp:=LeftStr(strTemp,Length(strTemp)-3);
Insert('-',strTemp,7);
Insert('-',strTemp,5);
dtTemp:=StrToDateTime(strTemp);具体问题具体分析
http://harryfin.spaces.live.com/Blog/cns!31E57C5D97ECDF5!409.entry?wa=wsignin1.0