Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 196
  • Last Modified:

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.
0
ignacioperez
Asked:
ignacioperez
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
the best thing you can do is to format dates everytime you output one.
0
 
sameer2010Commented:
yes, emoreau is correct!
this can be done using format function!
0
 
ignacioperezAuthor Commented:
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
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
Éric MoreauSenior .Net ConsultantCommented:
Without changing the regional settings, you can do it.
0
 
ignacioperezAuthor Commented:
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
0
 
ignacioperezAuthor Commented:
You're saying then, there is no way to change the displaying default date format for the entire application?
0
 
ignacioperezAuthor Commented:
You're saying then, there is no way to change the displaying default date format for the entire application?
0
 
Éric MoreauSenior .Net ConsultantCommented:
The only thing you can do is to format your date. There are no global settings for VB applications. You may want to create a public function that format it for all your application.
0
 
saurabhguptaCommented:
You can use the Cdate function to convert the text to date.
0
 
tsravankCommented:
You can convert the Date to Text when you are displaying so that it will not take date functions while output.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now