Time function

xiaoxiao2021-03-06  40

[0] Add the following statement before the application.run statement in the project file, can not let the master form display at runtime: Application.showMainform: = false; [1] Display Setting Time dialog SHELLEXECUTE (Handle, 'Open', ' Control ',' Date / Time ', NIL, SW_SHOW; [2] Formator (' YYYY MMMM ', MyDate) Returns such as [2008 December] [3] // Get Date: = Trunc (DateTime); / / Get time Time: = Frac (DateTime); [3] Calculate the number of days of any month Procedure TFORM1.BUTTON10Click (Sender: Tobject); Function DaySinmont (Adate: TdateTime): Integer; var myyear, mymonth, myday: word; mydayTable: TDayTable; tmpBool: Boolean; begin DecodeDate (aDate, MyYear, MyMonth, MyDay); tmpBool: = IsLeapYear (MyYear); MyDayTable: = monthDays [tmpBool]; Result: = MyDayTable [MyMonth]; end; var MyDate: TDateTime; tmpStr : String; tmpint: integer; begin mydate: = stratodatetime ('2003-12-01'); tmpstr: = formatdatetime ('yyyy mmmm', mydate); tmpint: = daysinmonth (MyDate); showMessage (Tmpstr 'has' INTOSTR (TMPINT) 'ìì'); END; [3] Change system time 1, define variable var SystemTime: TsystemTime; 2, conversion date DateTimetosystemTime (StrtodateTime); SetsystemTime () itself exists, after you change the system dates, wait for a while, you will see the system's date is right, but the time is wrong, not we set 11:12:12, this The problem seems to be Microsoft to solve the / method two / {setDate sets the current date in the operation system. Valid} {parameter Ranges Are: Year 1980-2099, Month 1-12 and day} {1-31. If the date Is Not Valid, The Function Call Is Ignored.} Procedure SetDate (Year, Month, Day: Word)

转载请注明原文地址:https://www.9cbs.com/read-86296.html

New Post(0)