LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   time functions in a c program (http://www.linuxquestions.org/questions/programming-9/time-functions-in-a-c-program-313691/)

mbacke 04-15-2005 07:06 PM

time functions in a c program
 
Can anybody help me ? I am a beginner in programming. I need to create a program than enables me to schedule some routine jobs. The problem is that these scheduled jobs do not take place at a fixed time : that is it depend on the time the sun rises, sets and cross the meridiem. So I have the whole year planned, but how to implement that in a c program is my nightmare. I would appreciate any help. Thanks

purefan 04-15-2005 09:47 PM

perhaps this helps:
http://search.microsoft.com/search/r...r+Instance&s=1

also you might find this useful:
Code:

// example for CTime::CTime
time_t osBinaryTime;  // C run-time time (defined in <time.h>)
time( &osBinaryTime ) ;  // Get the current time from the
                        // operating system.
CTime time1; // Empty CTime. (0 is illegal time value.)
CTime time2 = time1; // Copy constructor.
CTime time3( osBinaryTime );  // CTime from C run-time time
CTime time4( 1999, 3, 19, 22, 15, 0 ); // 10:15PM March 19, 1999

[b]CTIME does not have a base class.[/b}

A CTime object represents an absolute time and date. The CTime class incorporates the ANSI time_t data type and its associated run-time functions, including the ability to convert to and from a Gregorian date and 24-hour time.

you need to
Code:

#include <afx.h>
all this I took it from the MSDN and the help-search in VC++6

mbacke 04-18-2005 02:47 PM

Thanks for your help. I do appreciate it. But the problem is that I am using linux development tools (gcc ..), so I wander if the code still works under linux or it is applicable only under MsWindows;
Thank you!

Nad0xFF 04-18-2005 03:42 PM

it is C++. use info libc or man 2 time. There is written very much about time(..) functions


All times are GMT -5. The time now is 10:05 PM.