易截截图软件、单文件、免安装、纯绿色、仅160KB

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 函数能得到该日期是该月份的


相关文档:

delphi学习 字符串切割问题(split)

最近做一个项目,要用Delphi,以前从未学过,好是费劲啊,哈哈光是字符串切割这个问题就困扰了几个小时,通过查资料终于解决,在这与大家分享一下
Function split(src: pchar; ch: char):TStringList;
// 分割字符串
var
  i: Integer;
  tmp : string;
begin
  Result:=TStringList.Create;
  ......

Delphi线程_TThread代码分析

                                                   ......

Delphi中流的基本概念及函数声明

一、Delphi中流的基本概念及函数声明
在Delphi中,所有流对象的基类为TStream类,其中定义了所有流的共同属性和方法。 TStream类中定义的属性介绍如下: 1、Size:此属性以字节返回流中数据大小。 2、Position:此属性控制流中存取指针的位置。 Tstream中定义的虚方法有四个: 1、Read:此方法实现将数据从流中读出。函数原形为: ......

怎样用DELPHI接收摄像头的图象

community.csdn.net/Expert/topic/3423/3423580.xml?temp=.7675897
主  题:  怎样用DELPHI接收摄像头的图象 
作  者:  benbenpear (笨笨) 
等  级:   
信 誉 值:  100 
所属社区:  Delphi GAME,图形处理/多媒体 
问题点数:  0  ......

delphi如何获取屏幕的分辨率

屏幕的分辨率用这个  
  x=GetSystemMetrics(SM_CXSCREEN)  
 
y=GetSystemMetrics(SM_CYSCREEN)  
  同上。
.而且获得屏幕上的像素好像应该使用
screen.pixelsperinch函数
int   GetDeviceCaps(  
   
    ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号