|
-
Jun 27th, 2002, 02:02 PM
#1
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?
-
Jun 28th, 2002, 12:17 AM
#2
PowerPoster
You need to call the GetDateFormat API
-
Jun 28th, 2002, 06:52 AM
#3
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...)
-
Jun 28th, 2002, 08:03 AM
#4
Frenzied Member
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
Harry.
"From one thing, know ten thousand things."
-
Jun 28th, 2002, 08:09 AM
#5
Frenzied Member
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.
Harry.
"From one thing, know ten thousand things."
-
Jun 28th, 2002, 09:03 AM
#6
PowerPoster
yup, that a nice movie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|