C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-29-2009, 07:12 PM   #1
Registered User
 
Join Date: Jun 2009
Posts: 2
time calculations

I am attempting to write a program that take the system clock and store the individual components of the time (hour, minutes, seconds, etc.) in separate variables or an array. Does anyone know how to do this? I am newbie, so bear with me. Thanks.
posiedon is offline   Reply With Quote
Old 06-29-2009, 07:39 PM   #2
pwning noobs
 
Zlatko's Avatar
 
Join Date: Jun 2009
Location: The Great White North
Posts: 125
I think you need the localtime function. See localtime(3) - Linux man page .
To get the time_t parameter to pass into localtime, use time_t myTime = time(NULL);
Available on linux or Windows.
__________________
Sun Certified Java Programmer / Developer
IEEE CSDP
Zlatko is offline   Reply With Quote
Old 07-04-2009, 03:36 PM   #3
Registered User
 
Join Date: Jun 2009
Posts: 2
Thanks a bunch. I'm new to C programming.
posiedon is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get current time tsubasa C Programming 3 05-01-2009 02:03 AM
How to improve time performance of these operations lehe C Programming 11 03-29-2009 12:27 PM
calculating user time and time elapsed Neildadon C++ Programming 0 02-10-2003 06:00 PM
Is this really true or it's just science fiction? Nutshell A Brief History of Cprogramming.com 145 04-09-2002 06:17 PM
time class Unregistered C++ Programming 1 12-11-2001 10:12 PM


All times are GMT -6. The time now is 07:11 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22