Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1019
  • Last Modified:

Get Hour

Hi Expers,
First of all i`m a leecher so i only got 100 points left so bare with me xD.
Second i need a code that will show me the current hour, not the time (Timetostr(time)) but only the hour.
Thanks,
Cypher
0
cypherbad
Asked:
cypherbad
  • 3
  • 2
1 Solution
 
SteveBayCommented:
Something like this:

var HH,MM,SS,MS : Word
begin
     DecodeTime(Now,HH,MM,SS,MS);
     ShowMessageFmt('It is Hour %d',[HH]);
end;
0
 
SteveBayCommented:
you could alos use the
HourOf(Now)  
from  DateUtils
0
 
cypherbadAuthor Commented:
you could alos use the
HourOf(Now)  
from  DateUtils

and how to make it in a showmessage
0
 
cypherbadAuthor Commented:
i found out, thanks.
0
 
cypherbadAuthor Commented:
Thanks it worked using inttostr
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now