wilko1000
asked on
Vb Script change none date time value to valid date time
Hi
My script reads a text file that contains a datetime. Within the script I have a varible called strFieldData whch stores a datetime value.
Sometimes 99.99.99<2 white spaces>99:99:99 (date time) has been entered which is not valid date and time for the program that recieves this value.
I tried to convert this value using the Now function but its still keeping the same value:
If strFieldData = "99.99.99 99:99:99" then
strFieldData = Now
Still returns 99.99.99 99:99:99
Is there another way i can conert this value to the server date time?
My script reads a text file that contains a datetime. Within the script I have a varible called strFieldData whch stores a datetime value.
Sometimes 99.99.99<2 white spaces>99:99:99 (date time) has been entered which is not valid date and time for the program that recieves this value.
I tried to convert this value using the Now function but its still keeping the same value:
If strFieldData = "99.99.99 99:99:99" then
strFieldData = Now
Still returns 99.99.99 99:99:99
Is there another way i can conert this value to the server date time?
Post your complete script and the sample data text file. It seems that you If condition is not correct. E.g. number of spaces. Maybe there are trailing or leading spaces. Or milliseconds.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.