Re: Encode Date possible bug?

Eduardo Elias wrote:

> I have created a small example to test this on another computer and for my 
> surprise it worked inside the same VM I was having trouble.
> 
> As you can see there is nothing special, just what should be. The value comes 
> out as 31/12/2014 23:59:59.
> 
> Now my question, how can it turn differently in my other project? It is a 
> big project, hundreds of units. 
> 
> The results of floating points are overall suffering of rounding problems.
> 
> With this test means that my compiler is generating correct code, even in 
> FMX platform (same as my other project).
> 
> However my current project is taken from the Dev VM computer and run somewhere 
> else it works correcly. 
> 
> So there is some correlation between PC-Project 
> 
> Any ideas?

You did not say on what kind of hardware you are testing, but things that may affect the outcome
are among others:
- the FPU control word (see http://docwiki.embarcadero.com/Libraries/XE5/en/System.Set8087CW
- rounding mode see http://docwiki.embarcadero.com/Libraries/XE5/en/System.Math.SetRoundMode
- SSE round mode, see http://docwiki.embarcadero.com/Libraries/XE5/en/System.Math.SetSSERoundMode
All the referred pages have other links, worth reading.
Especially on x86 (with x87 fpu) I recall problems with 3rd party libraries changing the control
word to what they think is needed.

FWIW The result of your test routine on my W7 32 is the correct one 31/12/2014 23:59:59


-- 
Tom Brunberg
firstname.lastname@welho.com
0
Tom
1/17/2015 3:43:34 PM
embarcadero.algorithms 211 articles. 0 followers. Follow

2 Replies
1337 Views

Similar Articles

[PageSpeed] 16

> {quote:title=Tom Brunberg wrote:}{quote}
> Eduardo Elias wrote:
> 
....
> > The results of floating points are overall suffering of rounding problems.
....> > Any ideas?
 
Tom and Eduardo,

You may appreciate my suggestions and insight on this problem that you can find with

https://www.google.com/search?q=dateutils+herbster+tdatetime

and in the QC report #56957, titled 
"A Fix for DateUtils Date-Time Compare Functions", 
with sources for a program which tests suggested fix to the DateUtils module. For the details, see 
http://qc.embarcadero.com/wc/qcmain.aspx?d=56957

The qc report implies that it was fixed in 2010, in build 15.0.3730.28820.  If any of you readers know what was changed or fixed, I will be thankful for any feedback.

--JohnH
(I haven't dropped in here very often.  You may write me directly at herb-sci1@sbcglobal.net.)
0
John
2/14/2015 1:02:44 PM
> {quote:title=Tom Brunberg wrote:}{quote}
> Eduardo Elias wrote:
> [...]

Tom and Eduardo,
You may also like to review Nick Hodges' blogs mentions of DateUtils and TTimeStamp:
http://blogs.embarcadero.com/nickhodges?s=DateUtils&search.x=0&search.y=0
and 
http://blogs.embarcadero.com/nickhodges?s=TTimeStamp&search.x=1&search.y=5
--JohnH
0
John
2/14/2015 3:40:20 PM
Reply:

Similar Artilces:

Encode Date possible bug?
[xe7.1] This was functioning on XE6 and previous, I was not paying attention until I found this problem recently and I am still not understanding what is going on: When selecting ranges for reporting I usually do for end date EndOfTheDay(Date) Then this function gets my Date with no time on it and adds '23:59:59:99' to it. FOr example: 31/12/2014 should be added and get one milissecond before the new year. However it is turning to 01/01/2015 always. I have traced to this point on system.dateutils: function TryEncodeDateTime(const AYear, AMonth, ADay, AHour,...

Encode Date possible bug?
[xe7.1] This was functioning on XE6 and previous, I was not paying attention until I found this problem recently and I am still not understanding what is going on: When selecting ranges for reporting I usually do for end date EndOfTheDay(Date) Then this function gets my Date with no time on it and adds '23:59:59:99' to it. FOr example: 31/12/2014 should be added and get one milissecond before the new year. However it is turning to 01/01/2015 always. I have traced to this point on system.dateutils: function TryEncodeDateTime(const AYear, AMonth, ADay, AHour,...

RE: [POSSIBLE SPAM] Re: [perl #37855] perl bug?
VGhhbmtzIQ0KDQpKaW0NCg0KLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IGNocm9t YXRpYyB2aWEgUlQgW21haWx0bzpwZXJsYnVnLWZvbGxvd3VwQHBlcmwub3JnXQ0KU2VudDogVGh1 cnNkYXksIERlY2VtYmVyIDA4LCAyMDA1IDM6NDggUE0NClRvOiBKaW0gU2hpDQpTdWJqZWN0OiBb UE9TU0lCTEUgU1BBTV0gUmU6IFtwZXJsICMzNzg1NV0gcGVybCBidWc/DQoNCg0KT24gVGh1LCAy MDA1LTEyLTA4IGF0IDExOjA0IC0wODAwLCBKaW0gU2hpIHdyb3RlOg0KDQo+IG15ICR4eCA9IHsN Cj4gCSd0ZXN0JyA9PiAmdGVzdCgpLA0KPiAJJ25hbWUnID0+ICdqaW0nDQo+IAl9Ow0KDQpUaGlz IHVzZXMgdGhlIHZhbHVlcyByZXR1cm5lZCBmcm9tIHRlc3QoKSBpbiB0aGUgbGlzdCBvZiBrZXlz IGFuZCB2YWx1ZXMNCmZvciB0aGUgaGFzaC4NCg0KPiBzdWIgdGVzdC...

RE: We have a signed char/unsigned char bug (was Re: Syntax error in Encode/8859.c)
------_=_NextPart_001_01C1DBFF.BE0274E0 Content-Type: text/plain >and the messages from Mark Leighton Fisher is that all the testing has >been done on 7 bit ASCII files: All too true. I think Unicode is a wonderful idea, I strongly support making Perl Unicode-safe, but I have exactly zero experience working with 8 bit data (Thomson is a French company with English as the official language, so I've got no call for 8 bit data normally). [...] >I'm wondering if I should try benchmarking it on 8 bit data. My junk e-mail >folder, with all its Korean-language spam,...

Re: Re: Dates again.
Hi vmalik - At 2005-12-05, 07:09:51 you wrote: >I am assuming that localtime() returns the time in unix file format (number of >seconds since 12:00 AM on January 01, 1970). Why don't you convert 72 days to >seconds and subtract that number from the output of localtime()? No. time() returns epoch seconds ( seconds since 1-1-70 ), localtime() returns an array or formatted scalar. See perldoc -f time, localtime. > >For example, 72 days = 72 x 3600 x 24 seconds = 6220800 seconds > >So, try: > >-----------------------------------------------------...

possible Encode.pm bug
Greetings, While doing some work with UTF-16 text files, I've stumbled across what seems to be a bug in Encode.pm. Perl dies with the error "Unregognised BOM" when reading files with the example code below. Apparently, something is attempting to read a new BOM from the file every 1024 bytes. I have tested this by hex-editing a BOM into a UTF-16 file every 1024 bytes, and the code behaves properly. Unmodified UTF-16 files greater than 1024 bytes cause a crash. if (open FH, "test.txt") { binmode(FH, ":encoding(UTF-16)"); while...

RE: [cpan #3331] Possible bug?
------_=_NextPart_001_01C36B33.1CD90B5A Content-Type: text/plain Works like a charm! :-) Sorry for the noise, I can't figure out how I missed the latest version (0.74) when I installed this morning. I guess shouldn't touch the computer until *after* the morning caffeine! ;-) Thanks! Dan -----Original Message----- From: Autrijus Tang via RT [mailto:comment-PAR@rt.cpan.org] Sent: Monday, August 25, 2003 1:53 PM To: Regan, Daniel [BL60:CM71:EXCH] Cc: par@perl.org Subject: Re: [cpan #3331] Possible bug? Full context and any attached attachments can be found at: ...

RE: [perl #32463] Possible Bug
Dave, Thanks for your response. I appreciate you taking the time to review my situation. However, I'm not convinced that there is not a memory leak for the following reasons. 1. For the double hash of arrays, no array size is over 25. 2. I have monitored system memory while the script is running and have not been even close to running out of memory. 3. When the script crashes it produces a UNIX core dump file, disconnects me from my X session and does not allow anyone to telnet back into the system from that point on. One time when I was not immediately disconnecte...

Possible encoding bug in LDAP driver?
All, I'd like your opinion/help on something which I think is a bug in the LDAP driver. Suppose I have an entry in an iPlanet LDAP Directory Server (4.x) with a givenName containing two values: givenname: Test1 givenname: Test2 when I change Test1 to � (e with an accent to the right), this is what the driver sees in the LDAP changelog: dn: changenumber=1647,cn=changelog changetype: modify changes: replace: givenname givenname: Test1 givenname:: VGVzdDLDqQ== This is correct, one value is one is regular string and one is base64/octet (double colon). The driver t...

Bug Bug Bug!...
With the 2.0.0.13 and 4 tabs opened firefox crashes... or when a page is loading and clic on any link it crashes... i can't obtain a log or trace or something to give you for debug... ...

[PATCH re bug 200713.003] Re: Perlbug
This bug occurs when an installed perl does not have CPAN/Config.pm and a user runs cpan when he can not create CPAN/Config.pm and has a read only MyConfig.pm (my MyConfig.pm is under RCS). I have included a patch which merges some (attemptedly) repeated code, so that a change made to the first repeat also occurs in the second, which fixes this bug. Robin > From perlbug@rfi.net Mon Jan 28 13:05:37 2002 > Date: 28 Jan 2002 13:05:33 -0000 > From: perlbug@onion.perl.org > Subject: Perlbug - reminder of bug(20010713.003) status > X-Errors-To: perlbug@rfi.net >...

Dates, Dates, Dates!
Hello all... I am in the process of building an appointment system, and I am trying to see if I can get some pointers on which way to go on this. The first version of this appointment system was very lo-tech, and it stored all of the possible dates/times in the database. Once a user booked an appointment, their information was logged to that date/time, and then that date/time would no longer show in the list of possible openings. This was great for a temporary fix, but with having to pre-populate all of the dates/times, the system would eventually have to be updated to continue on pa...

Re: Automatic Update Possible Bug/or setting.
Name: Roger Email: gibsrocksathotmaildotcom Product: Firefox Summary: Re: Automatic Update Possible Bug/or setting. Comments: Hello, I have been using Mozilla Firefox for over a year now, and have had no problems until recently. I believe it is the next automatic update after the 2.0.0.11 version. After the update then Firefox does not connect to the internet at all. I have tried changing the settings, but the only thing that seems to work is a restore from two months ago mid-november. The date today is January 30th. I have just had to make a second restore in order to acc...

Web resources about - Re: Encode Date possible bug? - embarcadero.algorithms

British stunt woman in new Star Wars film reveals she will have an arm amputated
Olivia Jackson, Amersham, Buckinghamshire, was shooting a high-speed motorcycle chase when she crashed into a metal camera arm.

Watch the Awful Moment Steve Harvey Announced the Wrong Miss Universe Winner
Comedian Steve Harvey was tasked with hosting the 2015 Miss Universe pageant on Sunday night in Las Vegas. Harvey served as MC for several hours ...

One Person Held in Air France Bomb Hoax
ABC News One Person Held in Air France Bomb Hoax ABC News A man is in custody in Paris in relation to a bomb scare on an Air France flight ...

Spanish election: national newcomers end era of two-party dominance - World news - The Guardian
Podemos and Ciudadanos will hold balance of power in forthcoming coalition talks after People’s party fail to win clear majority

Police appeal for missing 19-year-old student who was last seen leaving hospital wearing gown and socks ...
Jenny Moody, a Newcastle University student, went missing from Harrogate Hospital this morning. Officers in Yorkshire took to Twitter to appeal ...

China Landslide Topples Buildings, Buries Dozens Under 20 Feet of Mud
NBCNews.com China Landslide Topples Buildings, Buries Dozens Under 20 Feet of Mud NBCNews.com BEIJING — At least 91 people remained missing ...

Blatter to appeal FIFA ban, says 'betrayed' by judges
Sepp Blatter said he will appeal against a Monday ruling by FIFA's ethics court banning him from football for eight years, claiming he was "betrayed" ...

US election 2016: Ted Cruz leads in Iowa, while Trump nabs New Hampshire and South Carolina
New CBS News poll also shows Democratic candidate Bernie Sanders holds the lead in New Hampshire.

Tim Cook talks about the future of Apple in 60 Minutes interview
This weekend's episode 60 Minutes on CBS featured a detailed look at Apple, with in-depth interviews with Angela Ahrendts, Apple's head of retail, ...

SpaceX delays launch and landing test of Falcon 9 rocket
(By Irene Klotz, Reuters) – Elon Musk’s SpaceX on Sunday postponed launch of an upgraded Falcon 9 rocket and an attempt to land the booster at ...

Resources last updated: 12/21/2015 12:32:23 PM