Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-06

Detecting X minutes ago.

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael Van Canneyt
to Richard Mace
Richard Mace wrote 7 lines
Hi All, What's the best way of detecting what Now - 5 minutes is? Effectively, I want to do the following: 5MinsAgo: TDateTime; 5MinsAgo := Now -5 minutes?
Uses DateUtils;
Var
   N : TDateTime;
begin
   N:=Now;
   N:=IncMinutes(N,-5);
end;

Or somesuch.

Michael.

Reply by email

aradeonas
to Richard Mace: What's the best way of detecting what Now - 5 minutes is? Effectively, I want to do the…

Hi,

Here is a simple way :

T:=Now()- StrToTime('00:05:00');

or more profesional way :

//add?dateutils to uses T:=IncMinute(Now(),-5);

Regards, Ara

http://www.fastmail.com - The professional email service -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150601/d921c0d2/attachment.html>

Reply by email

Marc Weustink
to aradeonas

Or
Now - 5 / MinutesPerDay

aradeonas wrote 10 lines
Hi, Here is a simple way : > T:=Now()- StrToTime('00:05:00'); or more profesional way : > //add?dateutils to uses > T:=IncMinute(Now(),-5); Regards, Ara

Reply by email