LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2005, 07:06 PM   #1
mbacke
LQ Newbie
 
Registered: Apr 2004
Location: Dakar, Senegal
Distribution: mandrake power pack 9.1, Debian Sarge, Debian Etch beta 2
Posts: 9

Rep: Reputation: 0
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
 
Old 04-15-2005, 09:47 PM   #2
purefan
Member
 
Registered: Aug 2003
Location: Sweden
Distribution: Ubuntu 10.04
Posts: 99

Rep: Reputation: Disabled
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
 
Old 04-18-2005, 02:47 PM   #3
mbacke
LQ Newbie
 
Registered: Apr 2004
Location: Dakar, Senegal
Distribution: mandrake power pack 9.1, Debian Sarge, Debian Etch beta 2
Posts: 9

Original Poster
Rep: Reputation: 0
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!
 
Old 04-18-2005, 03:42 PM   #4
Nad0xFF
Member
 
Registered: Apr 2005
Location: Russia, Saint-Petersburg
Distribution: Slackware 10
Posts: 109

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C# Server Program not advancing through functions mrobertson Programming 43 06-01-2005 02:42 PM
program with thread and time melinda_sayang Programming 2 05-28-2005 05:16 AM
Calling User-space program functions from Kernel modules shivanu Programming 1 03-05-2005 03:11 PM
program to set time darkleaf Linux - Software 3 10-03-2004 10:42 AM
pointers to functions/member functions champ Programming 2 03-28-2003 07:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration