?
Solved

Changing Default Date Format

Posted on 2003-03-21
10
Medium Priority
?
195 Views
Last Modified: 2010-05-01
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
Comment
Question by:ignacioperez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8184216
the best thing you can do is to format dates everytime you output one.
0
 
LVL 13

Expert Comment

by:sameer2010
ID: 8184236
yes, emoreau is correct!
this can be done using format function!
0
 
LVL 3

Author Comment

by:ignacioperez
ID: 8184250
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 8184255
Without changing the regional settings, you can do it.
0
 
LVL 3

Author Comment

by:ignacioperez
ID: 8184277
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
 
LVL 3

Author Comment

by:ignacioperez
ID: 8184284
You're saying then, there is no way to change the displaying default date format for the entire application?
0
 
LVL 3

Author Comment

by:ignacioperez
ID: 8184303
You're saying then, there is no way to change the displaying default date format for the entire application?
0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 150 total points
ID: 8184348
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
 
LVL 2

Expert Comment

by:saurabhgupta
ID: 8184367
You can use the Cdate function to convert the text to date.
0
 

Expert Comment

by:tsravank
ID: 8185695
You can convert the Date to Text when you are displaying so that it will not take date functions while output.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question