zoukankan      html  css  js  c++  java
  • Delphi 获取星期几

    unit Unit1;

    interface

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

    type
    TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    private
    { Private declarations }
    public
    { Public declarations }
    end;

    var
    Form1: TForm1;

    implementation

    {$R *.dfm}
    function getweek:string;
    var
    date:SYSTEMTIME ;
    begin
    GetLocalTime(date);
    case date.wDayOfWeek of
    0:Result := '星期日';
    1:Result := '星期一';
    2:Result := '星期二';
    3:Result := '星期三';
    4:Result := '星期四';
    5:Result := '星期五';
    6:Result := '星期六';
    end;

    end;

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    ShowMessage(getweek);
    end;

    end.


    编辑器加载中...

  • 相关阅读:
    简化单例模式
    static
    单例模式之懒汉模式
    Car race game
    poj-2403
    poj-2612
    poj-1833
    poj--2782
    poj--2608
    poj--3086
  • 原文地址:https://www.cnblogs.com/flay/p/2378552.html
Copyright © 2011-2022 走看看