RE : RE : [fpc-pascal] DateTimeToFileDate

2011-05-19 Thread Ludo Brands
di 19 mai 2011 09:36 À : cars...@beas.dk; 'FPC-Pascal users discussions' Objet : RE : [fpc-pascal] DateTimeToFileDate Delphi FileDate is UTC time based because the windows API FILETIME structure is UTC based. Delphi exposes the FileTimeToLocalFileTime API call to get the local tim

RE : [fpc-pascal] DateTimeToFileDate

2011-05-19 Thread Ludo Brands
-boun...@lists.freepascal.org] De la part de Carsten Bager Envoyé : jeudi 19 mai 2011 08:58 À : FPC-Pascal users discussions Objet : [fpc-pascal] DateTimeToFileDate If I do this on a Linux machine (Free Pascal Compiler version 2.4.2 [2010/11/08] for i386) WriteLn(DateTimeToFileDate(Now)); WriteLn(trunc

[fpc-pascal] DateTimeToFileDate

2011-05-18 Thread Carsten Bager
If I do this on a Linux machine (Free Pascal Compiler version 2.4.2 [2010/11/08] for i386) WriteLn(DateTimeToFileDate(Now)); WriteLn(trunc((now-EncodeDate(1970,1,1))*86400)); I get this 1305786833 1305794033 There is a difference of 7200= 2 hours. Is this correct? I would not expect a di

Re: [fpc-pascal] DateTimeToFileDate

2008-09-14 Thread Carsten Bager
> The FileDate format differ on unix and windows. UnpackTime uses the > windows format. You need another function for unix. Is the file date on Unix the number of seconds since 00:00:00 January 1, 1970. Carsten ___ fpc-pascal maillist - fpc-pascal@l

Re: [fpc-pascal] DateTimeToFileDate

2008-09-14 Thread Mattias Gaertner
On Sun, 14 Sep 2008 10:38:25 +0200 "Carsten Bager" <[EMAIL PROTECTED]> wrote: > > AFAIK the unit Dos should not be used under Linux. > > > > > > Mattias > > I rewrote the code omitting the dos unit, and got the fowing. > In my opinion the windows output and the Linux output should be > (almost)

Re: [fpc-pascal] DateTimeToFileDate

2008-09-14 Thread Carsten Bager
> AFAIK the unit Dos should not be used under Linux. > > > Mattias I rewrote the code omitting the dos unit, and got the fowing. In my opinion the windows output and the Linux output should be (almost) the same, and then my conclusion is a compiler/rtl error. Do you agree (I have also tested the 2

Re: [fpc-pascal] DateTimeToFileDate

2008-09-14 Thread Mattias Gaertner
On Sun, 14 Sep 2008 07:42:12 +0200 "Carsten Bager" <[EMAIL PROTECTED]> wrote: > > Zitat von Carsten Bager <[EMAIL PROTECTED]>: > > > > > 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 L

Re: [fpc-pascal] DateTimeToFileDate

2008-09-13 Thread Carsten Bager
> Zitat von Carsten Bager <[EMAIL PROTECTED]>: > > > When I do this > > > > Free Pascal Compiler version 2.2.2 [2008/07/29] for i386 > > Which OS? Linux > > > - > > Program tt; > > uses dos, > > sysutils; > > > > function strPackTime(t:longWord):shortstring; > > var

Re: [fpc-pascal] DateTimeToFileDate

2008-09-12 Thread Mattias Gärtner
Zitat von Carsten Bager <[EMAIL PROTECTED]>: > When I do this > > Free Pascal Compiler version 2.2.2 [2008/07/29] for i386 Which OS? > - > Program tt; > uses dos, > sysutils; > > function strPackTime(t:longWord):shortstring; > var > dt:Datetime; > begin > UnpackTime(

[fpc-pascal] DateTimeToFileDate

2008-09-12 Thread Carsten Bager
When I do this Free Pascal Compiler version 2.2.2 [2008/07/29] for i386 - Program tt; uses dos, sysutils; function strPackTime(t:longWord):shortstring; var dt:Datetime; begin UnpackTime(t,dt); strPackTime:=intToStr(dt.day)+'/'+ intToStr(dt.month)+'-'+