T
Tim:..
Hi
I have a bunch of dates I want to split into year, month, day and time variables
EG
2004-04-27TO08:00:0
I know how I can do this with 'len' but I think it is an inefficent way of doing it
var=var+
for i=0 to 9
sDayTime(var,i) = mid(sNodes(node,0),len(sNodes(node,0))-10
sDate(var,i) = left(sDayTime(var,i),len(sDayTime(var,i))-9
sTimeSec(var,i) = mid(sDayTime(var,i),len(sDayTime(var,i))- 7
sTime(var,i) = left(sTimeSec(var,i),len(sTimeSec(var,i))- 3
nex
I thought I could use 'split' to do the same thing but all my years end up in one variable all my months end up in another etc et
EG
myArray(0) = 20042005200
myArray(1) = 03040
myArray(2) = 26282
I guess it is because my loop is incorrect
How do I break it up so all my years, months or days are something like below
year(0) = 200
year(1) = 200
year(2) = 200
etc
...::This is my split code::.
'An example value for sNodes(node,0) is 2004-04-27TO08:00:0
dim myString, myArray,
DateTime = sNodes(node,0
myArray = Split(DateTime, "-"
for i = lbound(myArray) to ubound(myArray
Response.Write(myArray(i) & "<br />" & vbCrLf
nex
Thanks for any help
I have a bunch of dates I want to split into year, month, day and time variables
EG
2004-04-27TO08:00:0
I know how I can do this with 'len' but I think it is an inefficent way of doing it
var=var+
for i=0 to 9
sDayTime(var,i) = mid(sNodes(node,0),len(sNodes(node,0))-10
sDate(var,i) = left(sDayTime(var,i),len(sDayTime(var,i))-9
sTimeSec(var,i) = mid(sDayTime(var,i),len(sDayTime(var,i))- 7
sTime(var,i) = left(sTimeSec(var,i),len(sTimeSec(var,i))- 3
nex
I thought I could use 'split' to do the same thing but all my years end up in one variable all my months end up in another etc et
EG
myArray(0) = 20042005200
myArray(1) = 03040
myArray(2) = 26282
I guess it is because my loop is incorrect
How do I break it up so all my years, months or days are something like below
year(0) = 200
year(1) = 200
year(2) = 200
etc
...::This is my split code::.
'An example value for sNodes(node,0) is 2004-04-27TO08:00:0
dim myString, myArray,
DateTime = sNodes(node,0
myArray = Split(DateTime, "-"
for i = lbound(myArray) to ubound(myArray
Response.Write(myArray(i) & "<br />" & vbCrLf
nex
Thanks for any help