I have a VB6 program distributed to the company’s system admins around the world. Recently I found out, that under certain circumstances, the program fails with “Type mismatch” error 13.
The error happens when calculating day difference between the date from some database and actual local date.
Writing the program I assumed the date in form MM/DD/YYYY (I’m in US). The date in other part of the World can be in form DD.MM.YYYY or DD/MM/YYYY. When calculating the difference in days:
and having two different date/time formats, I’m getting an error.
Any ideas on how to fix the problem?
The error happens when calculating day difference between the date from some database and actual local date.
Writing the program I assumed the date in form MM/DD/YYYY (I’m in US). The date in other part of the World can be in form DD.MM.YYYY or DD/MM/YYYY. When calculating the difference in days:
Code:
iDays = DateDiff(“d”, DateTime1, DateTime2)
and having two different date/time formats, I’m getting an error.
Any ideas on how to fix the problem?