Is not a valid date and time 不是有效的日期格式
来源:互联网 发布:app推广网站源码 编辑:程序博客网 时间:2024/06/05 16:25
方法一:
var
sTime: TDateTime;
s1: String;
begin
//没有下面两行时转换会出错
ShortDateFormat := 'yyyy-MM-dd';
DateSeparator := '-';
//
s1 := '2012-03-20 12:30:40';
sTime := StrToDateTime(s1) + 1;
ShowMessage(FormatDateTime('yyyy-mm-dd hh:nn:ss',sTime));
end;
方法二:
uses
SysUtils
var
sTime: TDateTime;
s1: String;
aDateTimeFormat: TFormatSettings;
begin
//设定转换格式
aDateTimeFormat.DateSeparator := '-';
aDateTimeFormat.ShortDateFormat := 'yyyy-mm-dd';
aDateTimeFormat.TimeSeparator := ':';
aDateTimeFormat.ShortTimeFormat := 'hh:mm:ss';
s1 := '2012-03-20 12:30:40';
sTime := StrToDateTime(s1, aDateTimeFormat) + 1;
ShowMessage(FormatDateTime('yyyy-mm-dd hh:nn:ss',sTime));
end;
- Is not a valid date and time 不是有效的日期格式
- 字符串转日期 遇到Is not a valid date and time的解决
- 解决PLSQL提示 is not a valid date and time
- 怎样解决oracle报错is not a valid date and time
- Eclipse 修改注释的 date time 日期时间格式,即${date}变量格式
- Eclipse 修改注释的 date time 日期时间格式,即${date}变量格式
- VS2012编译出来的程序,在XP上运行,出现“.exe 不是有效的 win32 应用程序” “not a valid win32 application”
- VS2012编译出来的程序,在XP上运行,出现“.exe 不是有效的 win32 应用程序” “not a valid win32 application”
- VS2012编译出来的程序,在XP上运行,出现“.exe 不是有效的 win32 应用程序” “not a valid win32 application”
- VS2012编译出来的程序,在XP上运行,出现“.exe 不是有效的 win32 应用程序” “not a valid win32 application”
- 登陆时报错“2012-01-01 is not a valid date ”
- php编译安装:link: `ext/date/php_date.lo' is not a valid libtool objec
- settings/Date&time/Choose date format中增加自己定义的日期格式
- 应用程序"is not a valid Pocket PC Application"的解决方法
- is not a valid virtual path.
- 'my_calendar' is not a valid tag library
- %1 Is Not a Valid Win32 Application
- .exe is not a valid Win32 application
- 也学Oracle之筑基篇
- 简单的dll创建
- sk_buff 剖析
- 第五周任务(三)
- 从Git仓库中恢复已删除的分支或丢失的commit
- Is not a valid date and time 不是有效的日期格式
- 为Excel2010图表设置动态数据源
- Flex跨域调用Webservice 问题 解决 Channel.Security.Error
- NS-3有线网络脚本编写步骤( 以first.cc为例.mm)
- 模板 - 类模板
- 2012年3月20日C语言学习笔记
- 设计三角形类(是用带参数的构造函数)
- 宏碁看好Win8 2012年超极本出货量将占15%
- 基于用户投票的排名算法