[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Timer question

Posted on 2001-07-09
5
Medium Priority
?
199 Views
Last Modified: 2010-04-06
I want my Label1 shows now + 25 min. How can i do this?

When i do TimeToStr(Now) + 25 it gives error??
0
Comment
Question by:systemop
[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
5 Comments
 
LVL 5

Accepted Solution

by:
TheNeil earned 120 total points
ID: 6264189
TDateTime is a float value. The integer part gives the day and the decimal part gives the time. To add 25 minutes then you need to do this:

Label1.Caption := TimeToStr(Now + EncodeTime(0, 25, 0, 0));

You can't just ass 25 straight onto the time as that's not how it works. The above does

The Neil =:)
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 6264193
Sorry, that should be 'add' not 'ass'

The Neil =:)
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6264196
procedure TForm1.Button1Click(Sender: TObject);
var
  Hour, Min, Sec, MSec: Word;
 begin
  DecodeTime(Time,Hour,Min,Sec,MSec);
  Label1.Caption :=IntToStr(Hour) + ':' + IntToStr(Min + 25) + ':' + IntToStr(Sec);
end;
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6264208
Hi systemop,

const
  OneHour = 1/24;
  OneMin = OneHour / 60;
....
TimeToStr(Now+ 25*OneMin)  

-----
Igor.
0
 

Author Comment

by:systemop
ID: 6264236
Thanks man youre my hero..
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

656 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