-
C++ Dates...... HELP!!!!
I'm new to C++, have not done in a long time... I want to assign a date in the format of MM/DD/YYYY to a string..
In VB, I'd do it like this: a$ = format$(now,"MM/DD/YYYY")
How would you do something like this in C++?
I can find localtime and then asctime conversions, but then I'd have to parse the strings to build a date. Surely there must be an easier way?
-
You need to call the GetDateFormat API
-
Thanks for the reply!
Is that a win api? I have to do in straight C++ (Platform independant)... What library/header does that function reference?
(btw saw your signature - was KPax a good movie? Trying to talk the wife into renting it...)
-
I don't know about C++, but I have used C dates a little. There's probably a standard C++ class for it, but in the meantime have a look here:
http://www.cs.utah.edu/dept/old/texi...19.html#SEC309
-
This is all I turned up with a quick google:
http://www-f9.ijs.si/~matevz/docs/C+.../ch05/ch05.htm
You could probably use one of the classes in those examples.
-
yup, that a nice movie :)