Link to home
Start Free TrialLog in
Avatar of ignacioperez
ignacioperez

asked on

Changing Default Date Format

I'm developing a Visual Basic ActiveX wich must be able to run under many different servers, and I need to use always the same default date format (the format that will appear when I print a date or return it as a String). How can I set the default date format for all my VB application avoiding the regional setting?

Thanks a lot to anybody who can help me.
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

the best thing you can do is to format dates everytime you output one.
yes, emoreau is correct!
this can be done using format function!
Avatar of ignacioperez
ignacioperez

ASKER

I know I can use format function, but I still need to set the default date format. I want to do it as I do in ASP with the Session.LCID property
Without changing the regional settings, you can do it.
I know I can use format function, but I still need to set the default date format. I want to do it as I do in ASP with the Session.LCID property
You're saying then, there is no way to change the displaying default date format for the entire application?
You're saying then, there is no way to change the displaying default date format for the entire application?
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada 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
You can use the Cdate function to convert the text to date.
You can convert the Date to Text when you are displaying so that it will not take date functions while output.