delphi 判断时间是否是下午 DateUtils.IsPM


本文整理自网络,侵删。

 奇怪的事难道有一个isPM就没有一个 ISAM,外国人的思维真奇怪 肯定是认为
ISAM=not isPM 所以少写了一个,难道外国的日子是用PM开始?

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses DateUtils;

procedure TForm1.FormCreate(Sender: TObject);
var
  t1,t2: TDateTime;
  b1,b2: Boolean;
begin
  t1 := EncodeDateTime(2009, 5, 21, 11, 22, 33, 999);
  t2 := EncodeDateTime(2009, 5, 21, 12, 22, 33, 999);

  b1 := IsPM(t1); //False;
  b2 := IsPM(t2); //True;

  ShowMessage(BoolToStr(b1, True));
  ShowMessage(BoolToStr(b2, True));
end;

end.

相关阅读 >>

Delphi替换字符串中的单引号

Delphi日期函数、日期加减

Delphi图片格式判断

Delphi弹出信息框大全

idhttp访问网页出现socket error #10054错误

idhttp使用时内存猛增,如何解决

Delphi idftp 错误:socket error 10054 �c connection reset by peer -连接被重置

Delphi tms web core 从js调用pascal函数

Delphi 中窗体form显示在第二个显示器中的方法

Delphi copy 从字符串中复制指定范围中的字符

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...