Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Quboid

macrumors 6502
Original poster
Oct 16, 2006
441
0
everywhere
Hey people,

so far I haVe been advancing in my programing by finding function syntax on hte net and using logic to get through the rest. But I am in the middle of a cinema program and I am stuck in my ticket sales functions cause I can't (no matter how hard i try) to figure out how to use the "current time" (using getdate or whatever tha appropriate function is) in my program.
For the record i am going to use the time to subtract a discount to the buyer depending on the time of day of the movie. I really need help on this on, thanks, i appreciate it.

Q
 

pilotError

macrumors 68020
Apr 12, 2006
2,237
4
Long Island
Code:
 time_t now;
 struct tm *localTime;

	time( &now );

	localTime = localtime( &now );  /* Convert time to struct */

        printf("Time is now: %s", asctime( localTime ));
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.