开发者

Evaluating the current Hour in Delphi

I'm looking for the Delphi eqivalent to the following Ruby Code

if T开发者_开发问答ime.now.hour > 12  then
  # Statement; 
else
  # Alternative Statement;
end

Thanks Stefan


Use

if HourOf(Now) > 12 then
  // Statement
else
  // Alternative Statement;

after you've added DateUtils to your uses clause.


For example,

if Trunc (Time * 24) > 12 then ...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜