View Single Post
Old 07-07-2007, 01:21 PM   #10 (permalink)
Comedian2004
Hall Of Famer
 
Comedian2004's Avatar
 
Join Date: Nov 2004
Location: In a house in Saint Cloud, Florida.
Posts: 6,395
Since the date is always going to contain 8 characters, and if they are in this format: yyyymmdd (like the players history files)

Try this:

Code:
REM get date
yy = Mid(line, 1, 4)
mm = Mid(line, 5, 2)
dd = Mid(line, 7, 2)
 
You now have the date broke down into year, month and day, you can then re-format it the way you want:
 
line2 = MMMM(mm) & dd & ", " & yy
 
Whereas MMMM is an arrary as shown:
 
MMMM(1) = "January"
MMMM(2) = "Feburary"
etc.
line 2 will now be "January 1, 2000"

I wrote another routine that puts in the st or nd or rd in some spots where I needed it.

Or you can do whatever you want with it. Of course this is VB, not sure what you are using, but you should get the general idea.

Quote:
Originally Posted by Neags23 View Post
The date conversion is not so much a .CSV problem as it is my not taking the time necessary to figure it out.

It appears that for the game to read an entry in the player_history.txt file, the date has to be in a format like: 20070707. The CSV file holds the date as 2007-7-7. I've taken out the dashes, but that leaves me with 200777. So then I thought, I'll replace the dashes with 0's. That gives me 20070707. But what if the date is 2007-10-21? That gives me 2007010021, which isn't right at all.

So I just have to figure out how to properly format the date I pull from the .CSV file.
__________________
Visit www.planetootp.com for my MODS. Like BLUES? Visit www.smokestacklightnin.com, you will LOVE it! New show every Monday!! New Blues HOF!
Comedian2004 is offline   Reply With Quote