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
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.
|