Link to home
Start Free TrialLog in
Avatar of wilko1000
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?
Avatar of ste5an
ste5an
Flag of Germany image

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
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial