Archived

This topic is now archived and is closed to further replies.

Blue Mind

How do you get the date and time in c++

Recommended Posts

I know, I know... "GOOGLE IT!" "USE MSDN!" MSDN is f***ing useless, it gives me all good answers... but in JScript, Visual Basic, and just about everything else EXCEPT visual c++, despite my filtering the results to only visual c++. As I said before, it''s f***ing useless. So, my question: How do I get the Date and Time, and is there a function that returns this in a character string? cout << "Today is: " << DayofWeek() << ", " << Month() << " " << Day(); Is that too much to ask? It''s a simple question but its hard to find the answer. No, Microsoft, I''m not interested in JScript, despite your insistence. Thanks, Blue Mind
"In so many ways we live to follow the sun" - Bad Religion

Share this post


Link to post
Share on other sites
quote:
Original post by Blue Mind
MSDN is f***ing useless.
No, it isn''t. Most people are just too lazy and careless to learn to use it; it''s interface is different than Google - search is not its strong point, particularly if you don''t have a very specific fully-qualified identifier.

Luckily for you, I do. Time Management Routines. You''ll want to look at time(), localtime() and strftime().

Share this post


Link to post
Share on other sites
The key is to use MSDN *and* Google. That way you get Google''s rankings, and no extraneous results. Try this search on google: "site:msdn.microsoft.com get current time"


"Sneftel is correct, if rather vulgar." --Flarelocke

Share this post


Link to post
Share on other sites