Click to See Complete Forum and Search --> : Trimming fields


hgg
April 16th, 2002, 10:05 PM
Hi,

If i have a field like this

2001-07-31:19:01:59.46
2001-07-31:19:01:59.588

which i need to insert into database.

I split them out into 2 columns in the database
one is 2001-07-31 the other is 19:01:59.46
however I would like to remove the milliseconds of the second column into 19:01:59
how should i do this?


if(row[1].indexOf(":")>-1){
row[11] = row[1].substring(0,row[1].indexOf(":"));
row[12] = row[1].substring(row[1].indexOf(":")+1);
}




thanks and regards

hgg
April 17th, 2002, 12:00 AM
Hi,
i got it already.
Thanks