[fpc-pascal] DateTimeToFileDate

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Sep 14 10:02:19 CEST 2008


On Sun, 14 Sep 2008 07:42:12 +0200
"Carsten Bager" <carsten at beas.dk> wrote:

> > Zitat von Carsten Bager <carsten at beas.dk>:
> > 
> > > When I do this
> > >
> > > Free Pascal Compiler version 2.2.2 [2008/07/29] for i386
> > 
> > Which OS?
> Linux   

AFAIK the unit Dos should not be used under Linux.


Mattias


> > > ---------------------
> > > Program tt;
> > > uses dos,
> > >      sysutils;
> > >
> > > function strPackTime(t:longWord):shortstring;
> > > var
> > >   dt:Datetime;
> > > begin
> > >   UnpackTime(t,dt);
> > >   strPackTime:=intToStr(dt.day)+'/'+
> > >          intToStr(dt.month)+'-'+
> > >          intToStr(dt.year)+
> > >          intToStr(dt.hour)+':'+
> > >          intToStr(dt.min)+':'+
> > >          intToStr(dt.sec)+' ';
> > > end;
> > >
> > > Begin
> > >   WriteLn(strPackTime(DateTimeToFileDate(now)));
> > >
> > > WriteLn(DateTimeToStr(FileDateToDateTime(DateTimeToFileDate(now))))
> > > ;
> > > End.
> > > ---------------------------------
> > >
> > > I get this result
> > >
> > > 9/6-20160:28:22
> > > 11-9-08 13:39:55
> > >
> > > What am I doing wrong.
> > 
> > 
> > Mattias
> > 
> > _______________________________________________
> > fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> > http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> > 
> 
> 
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal



More information about the fpc-pascal mailing list