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
-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
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
> 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
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)
> 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
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
> 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
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(
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)+'-'+
10 matches
Mail list logo