system regional date

Posted on 2003-03-19
Medium Priority
Last Modified: 2010-05-01
How do I set the program to use a different system regional date, without changing the system regional date.

So for example, when I run my program I want it to display 13/03/2003 (UK format), instead of 03/13/2003 (US format) which is from my computer regional setting.

Tanks, my life saver
Question by:Tsai
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
  • 4
  • 3
LVL 38

Accepted Solution

PaulHews earned 800 total points
ID: 8170323
You can use the Format command to present the date the way you want it.

msgbox Format(Date, "dd/mm/yyyy")
LVL 11

Expert Comment

ID: 8170559
PaulHews is correct, but be careful if you use this format of "dd/mm/yyyy" in SQL statments to do date comparisons.  because Access SQL convert it to US format "mm/dd/yyyy" where ever possible.  So I recommend using "dd/mmm/yyyy" format in SQL.

Good Luck!

Author Comment

ID: 8174000
Sorry experts. I should be more clear on my question. I want the entire program to use a different regional date format. So what I mean is that when the program runs, it sets the regional date to UK, for example, but only within the scope of the program. So I do not need to use format() function, cauz I have lots of date text boxes, or that my program deals with dates a lot.

Thank U,

Since you guys already answered the question, and the problem is tricky, I should then double the points.
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 38

Expert Comment

ID: 8174068
>I want the entire program to use a different regional date format. ... it sets the regional date to UK, for example, but only within the scope of the program<

Unfortunately you can't set a system wide property just within the scope of your program.  The only thing I can suggest is that when you present ANY date by text box or label, you format it appropriately (this is a good practice anyway.)  If you don't like the idea of changing all those assignments, it might make it easier to wrap the format in a small function.  eg:

Text1.Text = fDt(Date)

Public Function fDt(dt as date) as string
 fDt = Format(dt, "dd/mm/yyyy")
End Function

It should be easier to insert that code into multiple assignments.


Author Comment

ID: 8174739
Thank you very much. I will create a function then.

Author Comment

ID: 8174796
I'm sorry, but I tried to split the point to PaulHews, and supunr, so I give PaulHews 150, and thinking that 50 would be left for supunr, but then as soon as I click submit the question is closed. So now it ended up that PaulHews only got 150 and supunr got nothing. How do I split the points experts?
LVL 38

Expert Comment

ID: 8175264
Actually I received the full 200.  Post a question asking for a point split in the Community Support topic area on the left hand side.  They should be able to reduce the points awarded on this question as well.

Author Comment

ID: 8175675
Thank you PaulHews for answering about the spliting points. If you have gotten full points then I will leave it like this for now, until next time on some other question.

Thank you again.

Featured Post


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

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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

770 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