Solved

Integer Overflow in DateTimeToTimeStamp function (Sysutils)

Posted on 2006-07-20
4
799 Views
Last Modified: 2010-04-04
I had a problem with a program that has been widely tested, but recently, in two computers  I started getting the Integer Overflow exception at random times (I can't get a pattern) when i try to access some date routines like formatdatetime or now. Madexcept has traced the problem back to the DateTimeToTimeStamp function in SysUtils, but it´s in assembler and I don't really remember much from my asm classes to know whats happening. I've searched all over the internet for a solution or someone with a similar problem but i haven't found anything. I suspect it may be relaed to the regional settings or something like that.

Does any one have a clue about what's happening here?

This is an excerpt from the related madexcept log.


operating system  : Windows XP Service Pack 2 build 2600
processors        : 2x Intel(R) Pentium(R) 4 CPU 3.20GHz
physical memory   : 212/447 MB (free/total)
free disk space   : (C:) 35.03 GB
exception class   : EIntOverflow
exception message : Integer overflow.

Main ($980):
004574e5 +025 Station.exe SysUtils           DateTimeToTimeStamp
00457684 +01c Station.exe SysUtils           DecodeTime
007810d1 +025 Station.exe JvClock            TJvClock.GetTime
007822c7 +047 Station.exe JvClock            TJvClock.PaintTimeStr
00781701 +0ed Station.exe JvClock            TJvClock.TimerExpired
0077ff37 +01b Station.exe JvTimer            TJvTimer.Timer
00476511 +0fd Station.exe Classes            CheckSynchronize
004c9b6a +6b2 Station.exe Forms    7398 +153 TApplication.WndProc
00478360 +014 Station.exe Classes            StdWndProc
77d196c2 +00a USER32.dll                     DispatchMessageA
004ca294 +0fc Station.exe Forms    7651  +23 TApplication.ProcessMessage
004ca2ce +00a Station.exe Forms    7670   +1 TApplication.HandleMessage
004ca4ee +096 Station.exe Forms    7754  +16 TApplication.Run



Thank You
0
Comment
Question by:Dissaster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 26

Accepted Solution

by:
Russell Libby earned 250 total points
ID: 17148231

The date time is obviously getting messed up, so couple of questions.

- Are you handling the OnGetTime event, and is it possible that the date / time value is getting messed up there?
- Have you tried placing a try / except handler in the TJvClock.GetTime method to allow you to log the value that is causing the exception?

The actual cause of the exception is this:

@@1:    DIV     IMSecsPerDay

And is caused by too large a number being passed in as a date time value. Also, any place where you are enabling / disabling the clock within an event handler that might call GetTime?

Regards,
Russell

0
 
LVL 12

Assisted Solution

by:Ivanov_G
Ivanov_G earned 250 total points
ID: 17151729
It is probably because different Regional Settings on the different computers. You can you Float (DateTime is Float) and the format it.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to build JSON File in Delphi 6 3 70
Graphics32 under Delphi 10.1 Berlin 2 125
Delphi: sending SMS on android platform 1 63
Problem working with dynamic array - help 2 35
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question