SB> I am trying to write a program to manage my user base on my BBS. The BBS
SB> software is called SpitFire and the Subscription date is defined in a
SB> record as type Longint. I have tried several of the delphi date
SB> routines with no success. Can someone give a small code example of how
SB> to decode a date in this format?
Steve,
I think you have to go back to TP 7 or so for a description in the
manuals of the time/date stamp. Here is some code which builds a TurboPascal
"Unit" which may be used to include a time/date of a source code "build".
(Who knows.... maybe Delphi already does that now? In any case, here is the
routine which MAY be a route to decoding the time/date stamp you are dealing
with, since it is "vintage" TP.)
Sorry about the ugly word-wrap:
Program MakeDate;
{ MAKEDATE was originally written by others. Modified for friendlier usage
by Justin Marquez, FidoNet 1:106/100 }
Uses DOS;
CONST
Str1 = 'WriteLn('' This Version Compiled on:
'',DT.Month,''/'',DT.Day,''/'',DT.Year) ;';
Str2 = 'WriteLn('' at: '',DT.Hour,'':'',DT.Min);';
VAR
TheClock : DateTime;
TimeStamp : LongInt;
Dummy : word;
OutFile : Text;
BEGIN
Assign (OutFile,'TPDATE.PAS');
ReWrite(OutFile);
{ build a time stamp.... }
With TheClock Do
Begin
GetTime(Hour,Min,Sec,Dummy);
GetDate(Year,Month,Day,Dummy);
PackTime(TheClock,TimeStamp);
WriteLn(OutFile,'Unit TPDATE ;');
WriteLn(OutFile,'INTERFACE');
WriteLn(OutFile,'Uses DOS;');
WriteLn(OutFile,'CONST');
WriteLn(OutFile);
WriteLn(OutFile,' CompileTime = ',TimeStamp,' ;');
WriteLn(OutFile);
WriteLn(OutFile,' { Human-readable info ......');
WriteLn(OutFile);
WriteLn(OutFile,' The "CompileTime" CONSTant equates to:');
WriteLn(OutFile);
WriteLn(OutFile,' Date: ',Month:2,'/',Day:2,'/',Year:4);
WriteLn(OutFile,' Time: ',Hour:2,':',Min:2,':',Sec:2);
WriteLn(OutFile);
WriteLn(OutFile,' }');
WriteLn(OutFile);
WriteLn(OutFile,' PROCEDURE DeCryptStamp;');
WriteLn(OutFile,'IMPLEMENTATION');
WriteLn(OutFile);
WriteLn(OutFile,'PROCEDURE DeCryptStamp;');
WriteLn(OutFile,' { Sample of how to use TPDATE for making a compile-time
stamp }');
WriteLn(OutFile,' { MAIN Program MUST have " Uses DOS,TPDATE; "');
WriteLn(OutFile,' Also, run MAKEDATE.EXE just before compiling your
program to');
WriteLn(OutFile,' update the TPDATE.PAS Unit File.');
WriteLn(OutFile,' Suggested .BAT file lines, or sequence of program
ops:');
WriteLn(OutFile,' MakeDate');
WriteLn(OutFile,' TPC /M YourPgm');
WriteLn(OutFile,' }');
WriteLn(OutFile,'VAR');
WriteLn(OutFile,' DT : DateTime; { found in the DOS unit }');
WriteLn(OutFile,'Begin');
WriteLn(OutFile,' UnpackTime(CompileTime,DT);');
WriteLn(OutFile,Str1);
WriteLn(OutFile,Str2);
WriteLn(OutFile,'End; { Of Procedure DeCryptStamp }');
WriteLn(OutFile);
WriteLn(OutFile,'END.');
End; { of the WITH clause }
Close(OutFile);
END.
{ Remember.... this writes a .PAS source code unit file!}
--- OPMED 3.20wb
---------------
* Origin: The Home Point (1:106/100.1)
|