C++ Topics and Explanations
Re: Handling Date Functions

[ Follow Ups ] [ Post Follow Up ] [ C++ Topics and Explanations ]

Posted by shahid riaz bhatti on December 21, 202 at 08:55:37:

In Reply to: Re: Handling Date Functions posted by Ravi Joshi on January 02, 201 at 19:14:01:

here is ur solution

CTime time;
int hh,mm,ss;
time=CTime.GetTime();
hh= time.GetHour()%12;
mm=time.GetMinute();
ss=time.GetSecond();

char buff[100];
if(time.GetHour>=12)
sprintf(buff,"Time:%d:%d:%d AM",hh,mm,ss)

else
sprintf(buff,"Time:%d:%d:%d PM",hh,mm,ss)

"Now By using Buffer u can place it any where, on the status bar or on the client area.




Follow Ups:


Post a Follow Up:

Name:
E-Mail:

Subject:

Comments:


[ Follow Ups ] [ Post Follow Up ] [ C++ Topics and Explanations ]