Is it possible to retrieve hour from TTime object in 开发者_运维百科c++ builder
without using DecodeTime(args), by doing calculations ?
The HourOf function returns the current hour of a TDateTime value.
// get hour from the current time
int Hour;
Hour = HourOf(Now());
Have a look at the DateUtils unit, which include lots of useful functions for handing dates and times.
精彩评论