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

Started by
2 comments, last by Blue Mind 19 years, 11 months ago
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
"In so many ways we live to follow the sun" - Bad Religion
Advertisement
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().
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
Duly noted,

Merci Beaucoup mods
"In so many ways we live to follow the sun" - Bad Religion

This topic is closed to new replies.

Advertisement