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

Date/Time in C++ 3

Status
Not open for further replies.

biot023

Programmer
Nov 8, 2001
403
GB
Hallo - is there a simple way of getting at the date/time in C++? Some struct or class or other I could use?

Cheers,
Douglas JL
Common sense is what tells you the world is flat.
 
If you are using Builder, you can use the functions in Sysutils.h. See for some examples. James P. Cottingham

When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity.
[tab][tab]Albert Einstein explaining his Theory of Relativity to a group of journalists.
 
m_sDate = DateToStr(Date());
TDateTime TimeString = Time();
 
You may use the regular C-Library-functions time,ctime,localtime.....

May be its better for compatibility.


hnd
hasso55@yahoo.com

 
Cheers - I think I'm gonna play with the second two options, but that SystemUtils page will come in well handy.
Thanks again,
Douglas JL Common sense is what tells you the world is flat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top