?
Solved

system regional date

Posted on 2003-03-19
8
Medium Priority
?
222 Views
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
0
Comment
Question by:Tsai
  • 4
  • 3
8 Comments
 
LVL 38

Accepted Solution

by:
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")
0
 
LVL 11

Expert Comment

by:supunr
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!
0
 

Author Comment

by:Tsai
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.
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.

 
LVL 38

Expert Comment

by:PaulHews
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.

0
 

Author Comment

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

Author Comment

by:Tsai
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?
0
 
LVL 38

Expert Comment

by:PaulHews
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.
0
 

Author Comment

by:Tsai
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.
0

Featured Post

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.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…
Suggested Courses

621 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