Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date problem

Status
Not open for further replies.

benaam

Programmer
Jan 11, 2001
20
US
Hi All
How do i get the current date in "yyyy/mm/dd hh:mm:ss" format? And how do I get the time difference between two dates?I want to get the difference in hours

 
Look at the time.h header file. It has functions asctime, clock, ctime, difftime, gmtime, localtime, mktime, randomize, stime, _strdate, strftime, _strtime, time, and tzset

Sounds like you want difftime which calcs the difference in times by seconds.

Borland also a date.h header for dates. There are also some precompile headers that include both functions.
James P. Cottingham
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top