|
@@ -211,6 +211,9 @@ procedure GetTime(var hour,min,sec,sec100:word);
|
|
|
procedure GetTime(var hour,min,sec:word);
|
|
|
Procedure GetDate(Var Year,Month,Day:Word);
|
|
|
Procedure GetDateTime(Var Year,Month,Day,hour,minute,second:Word);
|
|
|
+function SetTime(Hour,Min,Sec:word) : Boolean;
|
|
|
+function SetDate(Year,Month,Day:Word) : Boolean;
|
|
|
+function SetDateTime(Year,Month,Day,hour,minute,second:Word) : Boolean;
|
|
|
|
|
|
{**************************
|
|
|
Process Handling
|
|
@@ -871,6 +874,49 @@ Begin
|
|
|
EpochToLocal(GetTimeOfDay,year,month,day,hour,minute,second);
|
|
|
End;
|
|
|
|
|
|
+{$ifdef linux}
|
|
|
+Function stime (t : longint) : Boolean;
|
|
|
+var
|
|
|
+ sr : Syscallregs;
|
|
|
+begin
|
|
|
+ sr.reg2:=longint(@t);
|
|
|
+ SysCall(Syscall_nr_stime,sr);
|
|
|
+ linuxerror:=errno;
|
|
|
+ stime:=linuxerror=0;
|
|
|
+end;
|
|
|
+{$endif}
|
|
|
+
|
|
|
+{$ifdef BSD}
|
|
|
+Function stime (t : longint) : Boolean;
|
|
|
+begin
|
|
|
+end;
|
|
|
+{$endif}
|
|
|
+
|
|
|
+Function SetTime(Hour,Min,Sec:word) : boolean;
|
|
|
+var
|
|
|
+ Year, Month, Day : Word;
|
|
|
+begin
|
|
|
+ GetDate (Year, Month, Day);
|
|
|
+ SetTime:=stime ( LocalToEpoch ( Year, Month, Day, Hour, Min, Sec ) );
|
|
|
+end;
|
|
|
+
|
|
|
+Function SetDate(Year,Month,Day:Word) : boolean;
|
|
|
+var
|
|
|
+ Hour, Minute, Second, Sec100 : Word;
|
|
|
+begin
|
|
|
+ GetTime ( Hour, Minute, Second, Sec100 );
|
|
|
+ SetDate:=stime ( LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) );
|
|
|
+end;
|
|
|
+
|
|
|
+Function SetDateTime(Year,Month,Day,hour,minute,second:Word) : Boolean;
|
|
|
+
|
|
|
+begin
|
|
|
+ SetDateTime:=stime ( LocalToEpoch ( Year, Month, Day, Hour, Minute, Second ) );
|
|
|
+end;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
{ Include timezone handling routines which use /usr/share/timezone info }
|
|
|
{$i timezone.inc}
|
|
|
|
|
@@ -2890,7 +2936,10 @@ End.
|
|
|
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.11 2001-07-10 18:04:37 peter
|
|
|
+ Revision 1.12 2001-07-12 07:20:05 michael
|
|
|
+ + Added setdate/time/datetime functions
|
|
|
+
|
|
|
+ Revision 1.11 2001/07/10 18:04:37 peter
|
|
|
* merged textfile, readlink and concat ansistring fixes
|
|
|
|
|
|
Revision 1.10 2001/06/03 20:19:09 peter
|