We have a a VB6 app (in a COM component) which uses CDate() to take a string and cast it to a Date, for storing in a database.
Depending on if we want the application to talk in dd/MM/yy or MM/dd/yy for example, we have to change the regional settings of the identity user for the COM application. (Right now the only option we have is a nasty hack.)
We have a date format string which is used for formatting all output dates, and it is assumed that the date
If this were .NET we would use DateTime.ParseExact and be away laughing. Calling out to a COM object written in .NET for this sole purpose is an option. Is there a different or better option, involving some black magic around the Format command, or a long reusable function that tokenizes the date depending on the format string, etc?
See Question&Answers more detail:os