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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C++ time functions?

Status
Not open for further replies.

SmileeTiger

Programmer
Mar 13, 2000
200
0
0
US
What are the time functions in C++?<br><br>I used them at one point in time but I can't remember what they are.
 
&nbsp;&nbsp;&nbsp;&nbsp;There are several date/time functions in Borland/Inprise C++. They are prototyped in SYSUTILS.HPP. For some time functions, you have:<br><br><b>TDateTime EncodeTime(Word Hour, Word Min, Word Sec, Word MSec)</b> which encodes the hour, minute, second, and millisecond and returns a <i>TDateTime</i>.<br><br><b>void DecodeTime(TDateTime Time, Word &Hour, Word &Min, Word &Sec, Word &MSec)</b> reverses the previous function.<br><br><b>TDateTime Time(void)</b> returns the current system time.<br><br><b>AnsiString TimeToStr(TDateTime Time)</b> converts a <i>TDateTime</i> to an <i>AnsiString</i>.<br><br><b>TDateTime StrToTime(const AnsiString S)</b> reverses the above function.<br><br>&nbsp;&nbsp;&nbsp;&nbsp;In addition, you can several variables you can change that deal with functions including <i>TimeSeparator, TimeAMString, TimePMString, ShortTimeFormat, and LongTimeFormat</i>.<br> <p>James P. Cottingham<br><a href=mailto: > </a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.
 
Or else just include the time.h file . <p>Siddhartha Singh<br><a href=mailto:siddhu_singh@hotmail.com>siddhu_singh@hotmail.com</a><br><a href=siddhu.freehosting.net> </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top