Delphi 日期函数
Day 开头的函数
●
Unit
DateUtils
function DateOf(const Avalue: TDateTime): TDateTime;
描述
使用 DateOf 函数用来把一个 TDateTime 类型的变量转变成一个
只带有日期的 TDateTime 类型变量。
例如:
showmessage(DateTimetostr(dateof(now())));
你得到的是 2003/03/19
而 showmessage(DateTimetostr((now())));
得到的是 2003/03/19 10:50:49
●function DateTimeToStr(DateTime: TDateTime): string;
描述
DateTimeToString 函数将 TDateTime 类型的参数 DateTime 转换成一个
字符串,使用给定的全局变量 ShortDateFormat 的格式,时间部分按照
给定的全局变量 LongTimeFormat 的格式。
其中 DateTime 为零的部分将不会显示出来。
例如:
ShortDateFormat:=’yyyy mm dd’;
showmessage(DateTimetostr((now())));
你将得到:2003 03 19 10:50:49
●procedure DateTimeToString(var Result: string; const Format: string; DateTime: TDateTime);
描述:
DateTimeToString 方法将TDateTime类型的参数DateTime 按照由参数Format提供的格式
转化成字符串,并保存在Result中。
对于Format的格式类型,请看 Date-Time format strings 的帮助。
例如:
DateTimeToString(result,’yyyy mm dd’,now());
那么 result的结果为:2003 03 19 10:50:49
●procedure DateTimeToSystemTime(DateTime: TDateTime; var SystemTime: TSystemTime);
描述:
有时为了调用API函数来使用系统时间,你可以使用 DateTimeToSystemTime 方法,来将一个
TDateTime 类型的时间变量转换成一个 TSystemTime 类型的 系统时间。
●function DateTimeToUnix(const Avalue: TDateTime ): Int64;
描述:
使用 DateTimeToUnix 函数来将一个 TDateTime 型时间变量转换成一个相应的 Unix 格式
的日期和时间。
Unix date-and-time values are encoded as the number of seconds that have elapsed
since midnight at the start of January 1, 1970.
●function DateToStr(Date: TDateTime): string;
描述:
使用 DateToStr 函数能得到 TDateTime 日期时间类型的日期部分。日期的转换格式依赖于
全局变量 ShortDateFormat。
●function DayOf(const Avalue: TDateTime): Word;
描述:
对于给定的TDateTime类型的日期时间,使用 DayOf 函数能得到该日期是该月份的
相关文档:
http://www.delphibbs.com/delphibbs/dispq.asp?LID=2421470
本文是《Delphi 的RTTI机制浅探》的续篇,上篇地址在:
http://www.delphibbs.com/delphibbs/dispq.asp?lid=2420610
本文上篇基本上是
RTTI 入门介绍,续篇介绍了所有 TypInfo.pas 中的函数,附加了 Classes.pas、Graphics.pas、Controls.pas
中的 ......
http://developer.51cto.com/art/200510/7205.htm
[DELPHI]网络邻居复制文件
uses shellapi;
copyfile(pchar('newfile.txt'),pchar('//computername/direction/targer.txt'),false);
[DELPHI]产生鼠标拖动效果
通过MouseMove事件、DragOver事件、EndDrag事件实现,例如在PANEL上的LABEL:
var xpanel,ypanel,xlabel,yla ......
Delphi中的容器类
作者 陈省
从Delphi 5开始VCL中增加了一个新的Contnrs单元,单元中定义了8个新的类,全部都是基于标准的TList 类。
TList 类
TList 类实际上就是一个可以存储指针的容器类,提供了一系列的方法和属性来添加,删除,重排,定位,存取和排序容器中的类,它是基于数组的机制来实现 ......
//**************需要强调的两个快捷键**********************
51.CTRL+SHIFT+U 代码整块左移2个空格位置
52.CTRL+SHIFT+I 代码整块右移2个空格位置
60.Ctrl+Alt+c 注释块
61.Ctrl+Alt+u & ......
community.csdn.net/Expert/topic/3423/3423580.xml?temp=.7675897
主 题: 怎样用DELPHI接收摄像头的图象
作 者: benbenpear (笨笨)
等 级:
信 誉 值: 100
所属社区: Delphi GAME,图形处理/多媒体
问题点数: 0 ......