Get Current System Time 
Author Message
 Get Current System Time

How do I get the current Hour, Minute, and Second, each in their own int
value?  I tried CTime:GetHour, but it doesn't work with hour?  What can I
do?

Please Help!!!

I'll be especially greatfull if I get a sample..

(VC++5)

Thanks ahead of time, and I'de appreciate it greatly if you emailed the info



Tue, 03 Oct 2000 03:00:00 GMT  
 Get Current System Time

REFER KB ARTICLE
HOWTO: Display the Current Time in a CStatusBar Pane
Article ID: Q99198
http://support.microsoft.com/support/kb/articles/q99/1/98.asp
IT IS CLEARLY EXPLAINED WITH EXAMPLE

CTime t = CTime::GetCurrentTime();
char szTime[6];
int nHour = t.GetHour();
int nMinute = t.GetMinute();

--
-------------------------------------------------------
Rajesh Parikh
Microsoft Certified Solution Developer

-------------------------------------------------------

Quote:

>How do I get the current Hour, Minute, and Second, each in their own int
>value?  I tried CTime:GetHour, but it doesn't work with hour?  What can I
>do?

>Please Help!!!

>I'll be especially greatfull if I get a sample..

>(VC++5)

>Thanks ahead of time, and I'de appreciate it greatly if you emailed the
info




Wed, 04 Oct 2000 03:00:00 GMT  
 Get Current System Time

Or, just for fun (and to point out a bug) you could do this:

CTime t = CTime::GetTickCount();
char szTime[6];
int nHour = t.GetHour();

Quote:

>REFER KB ARTICLE
>HOWTO: Display the Current Time in a CStatusBar Pane
>Article ID: Q99198
>http://support.microsoft.com/support/kb/articles/q99/1/98.asp
>IT IS CLEARLY EXPLAINED WITH EXAMPLE

>CTime t = CTime::GetCurrentTime();
>char szTime[6];
>int nHour = t.GetHour();
>int nMinute = t.GetMinute();

>--
>-------------------------------------------------------
>Rajesh Parikh
>Microsoft Certified Solution Developer




Wed, 04 Oct 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting current system time in milliseconds

2. Getting the current date/time

3. Current System Time

4. How to get current system time

5. getting and useing system time

6. getting system time on NT

7. Getting system time

8. getting wrong system time

9. getting the system time format

10. Getting idle time of system/os

11. Getting system date/time at midnight?

12. runtime needed (getting system time?)

 

 
Powered by phpBB® Forum Software