Re: [fpc-devel] When is FPC 3.0.2 due?

2016-06-28 Thread Sven Barth
Am 28.06.2016 22:23 schrieb "vfclists ." :
>
> I have been looking forward the release of FreePascal 3.0.2 but there
doesn't seem to be any conversations about it
>
> My main concern though is some critical bugs in currency  arithmetic, Bug
29760, that are supposed to go nto 3.0.2. I don't mind using fixes if it
has been committed to fixes, which last saw activity 3 weeks ago according
to ViewVC.

The fix should already be in fixes.

And the tagging and building of 3.0.2 should start soon (TM).

Regards,
Sven
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


[fpc-devel] When is FPC 3.0.2 due?

2016-06-28 Thread vfclists .
I have been looking forward the release of FreePascal 3.0.2 but there
doesn't seem to be any conversations about it

My main concern though is some critical bugs in currency  arithmetic, Bug
29760, that are supposed to go nto 3.0.2. I don't mind using fixes if it
has been committed to fixes, which last saw activity 3 weeks ago according
to ViewVC.

-- 
Frank Church

===
http://devblog.brahmancreations.com
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC V3.0.0 LocalTimeToUniversal() error

2016-06-28 Thread Michael Van Canneyt



On Tue, 28 Jun 2016, wkitt...@windstream.net wrote:


On 06/28/2016 03:18 AM, Michael Van Canneyt wrote:

On Tue, 28 Jun 2016, Russ Davies wrote:

[...]
Comparing dateutil.inc for both versions, in functions 
UniversalTimeToLocal()

and LocalTimeToUniversal() the signs of the offsets have been changed


Correct. This was in response to some bugreports. IMO the offset should be 
120,

not -120.


so GetLocalTimeOffset() is wrong and has been for a long time??


Nono. I spoke from (fuzzy) memory, but now I did some deeper investigation.

FPC 3.0 indeed contains a bug. This has meanwhile been fixed.

If I compile the program with trunk, I get:

home: >fpc tt.pp
home: >./tt
Offset :-120
Local Time :10:53:16
UTC:08:53:16
home: >date --utc
Tue Jun 28 08:53:25 UTC 2016
home: >date 
Tue Jun 28 10:53:29 CEST 2016


So the output is correct in trunk, and the bug has been fixed. 
I expect the fix to be in 3.0.2.


My apologies for the confusion.

Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC V3.0.0 LocalTimeToUniversal() error

2016-06-28 Thread wkitty42

On 06/28/2016 03:18 AM, Michael Van Canneyt wrote:

On Tue, 28 Jun 2016, Russ Davies wrote:

[...]

Comparing dateutil.inc for both versions, in functions UniversalTimeToLocal()
and LocalTimeToUniversal() the signs of the offsets have been changed


Correct. This was in response to some bugreports. IMO the offset should be 120,
not -120.


so GetLocalTimeOffset() is wrong and has been for a long time??


cat ~/development/fpc/2.6.4/rtl/unix/sysutils.pp
cat ~/development/fpc/3.0.0/rtl/unix/sysutils.pp
cat ~/development/fpc/fixes_3_0/rtl/unix/sysutils.pp

function GetLocalTimeOffset: Integer;

begin
 Result := -Tzseconds div 60;
end;



--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC V3.0.0 LocalTimeToUniversal() error

2016-06-28 Thread wkitty42

On 06/27/2016 11:55 PM, Russ Davies wrote:

Hi,

My local time zone is GMT +2, and have noticed that with V3.0.0, that the
LocalTimeToUniversal() function is adding the offset instead of subtracting it:


i get the same over here...


Comparing dateutil.inc for both versions, in functions UniversalTimeToLocal()
and LocalTimeToUniversal() the signs of the offsets have been changed


yeah, it does look backwards... i'm currently -0400 and the program says

2016 Jun 28  03:06:20 -0400
myuser@mymachine:~/development/projects/misc$ ./timetest.2.6.4
Offset :240
Local Time :03:06:21
UTC:07:06:21

2016 Jun 28  03:06:21 -0400
myuser@mymachine:~/development/projects/misc$ ./timetest.3.0.0
Offset :240
Local Time :03:06:22
UTC:23:06:22


i don't understand why LocalTimeToUniversal() isn't more simple... subtracting a 
negative is the same as adding the positive and subtracting a positive is, well, 
subtracting... it looks like they were trying to catch and protect from division 
by zero when the offset is 0 or there is no offset which results in the offset 
being 0... the following should work and be easier to follow...



Function LocalTimeToUniversal(LT: TDateTime;TZOffset: Integer): TDateTime;

begin
  if (TZOffset <> 0) then
Result := LT - EncodeTime(TZOffset div 60, TZOffset mod 60, 0, 0)
  else
Result := LT;
end;


at least they're not trying to determine which timezone specification is in 
use... the two that i know of are backwards from each other... using the 
standard (POSIX??) form, i'm EST5EDT (-0500 and -0400) but using the other form 
(America/New York or Etc/GMT-5 ???) i'm 0500 and 0400 which means that the 
formula for the standard form is subtracting whereas the other one is adding 
when going from local time to GMT time... yeah, it gets really twisted and using 
the wrong form, while correct for your area, can result in time being off by 12 
hours (IIRC)...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC V3.0.0 LocalTimeToUniversal() error

2016-06-28 Thread LacaK

Dňa 28.6.2016 o 9:18 Michael Van Canneyt napísal(a):



On Tue, 28 Jun 2016, Russ Davies wrote:


Hi,

My local time zone is GMT +2, and have noticed that with V3.0.0, that 
the LocalTimeToUniversal() function is adding the offset instead of 
subtracting it:


uses  sysutils, dateutils;
var
 LocalTime: TDateTime;
begin
 LocalTime := Now();
 writeln('Offset :', GetLocalTimeOffset());
 writeln('Local Time :', TimeToStr(LocalTime));
 writeln('UTC:', TimeToStr(LocalTimeToUniversal(LocalTime)));
end.

Under 2.6.4 produces:

Offset : -120
Local Time : 05:29:13
UTC: 03:29:13

With 3.0.0:

Offset :-120
Local Time :05:31:16
UTC:07:31:16

Comparing dateutil.inc for both versions, in functions 
UniversalTimeToLocal() and LocalTimeToUniversal() the signs of the 
offsets have been changed
IIRC original implementation was based on Microsoft logic of 
GetTimeZoneInformation, where is stated:


"All translations between UTC time and local time are based on the 
following formula:


UTC = local time + bias

The bias is the difference, in minutes, between UTC time and local time."

-Laco.

___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] FPC V3.0.0 LocalTimeToUniversal() error

2016-06-28 Thread Michael Van Canneyt



On Tue, 28 Jun 2016, Russ Davies wrote:


Hi,

My local time zone is GMT +2, and have noticed that with V3.0.0, that the 
LocalTimeToUniversal() function is adding the offset instead of subtracting 
it:


uses  sysutils, dateutils;
var
 LocalTime: TDateTime;
begin
 LocalTime := Now();
 writeln('Offset :', GetLocalTimeOffset());
 writeln('Local Time :', TimeToStr(LocalTime));
 writeln('UTC:', TimeToStr(LocalTimeToUniversal(LocalTime)));
end.

Under 2.6.4 produces:

Offset : -120
Local Time : 05:29:13
UTC: 03:29:13

With 3.0.0:

Offset :-120
Local Time :05:31:16
UTC:07:31:16

Comparing dateutil.inc for both versions, in functions UniversalTimeToLocal() 
and LocalTimeToUniversal() the signs of the offsets have been changed


Correct. This was in response to some bugreports. 
IMO the offset should be 120, not -120.


Michael.
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel