Do you have any code to fix it.
Main Topics
Browse All TopicsHi Guys,
i use vb6 ,Access 2000 Database. my format date is like below. But why diffrence os PC show diffrence format.
CqDate = Format(Date, "dd/MM/yyyy")
in winxp the date show 12/30/2005 but in win2k it show 30/12/2005i i want both os PC also show 30/12/2005. Pls advice.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Yeah id noticed the same thing.
Its down to the individual OS and to do with system settings.
The splitting of the date using sirbounty's example should work, i think thats what i did for one of my projects when that occurred.
Have you checked whether your database attribute (i'm presuming this is happening in the database) hasen't got it the other way round?
That could cause it, if i remember correctly.
neutrinohunter
Hi aarontham:
I think sirbounty's question points to the right direction.
If CqDate is a string, then your program should work properly
If CqDate is declared as a date, then it does not really matter that you are using Format. A date is a date is a date. It is stored in the system as a double.
So, for example the 30th of December 2005 is stored as the number 38716.
It is 38716 in Australia (default format dd/MM/yyyy) and it is stored as 38716 in the USA (default format MM/dd/yyyy)
Hence, if CqDate is declared as a date, then your statement will still cause CqDate to have the value of 38716.
it then depends on your regional settings on how CqDate is displayed.
The question is more how and where you are showing the date.
The recommended control for it is a datepicker control. The control has a property that allows you to choose the way you want to display your date.
Furthermore, your example shows the 30th of December. If instead the date would be say, the 3rd of December , then there is a good chance that the value of CqDate (declared as a date) would change to the 12th of March, depending on your regional settings!
In short
Dim CqDate as String will probably solve this problem. (It may cause problems elsewhere in your program, if it requires to be a date)
Dabas
What type is: CqDate
If it is a date then to will store: Format(Date, "dd/MM/yyyy") as a date not a string.
If you want it to shou in a certain way you must store it in a astring.
i.e.
Dim CqDate As String
should fix the problem.
Alternativley if you go into control panel and change the Regional to say that each PC is in the same country. You would have to do this on both PCs.
pjcrooks2000,
Please read my previous post. CDating a string will not change its format. A date remains a date.
As I said before. A date is stored as a double. Through the Format function you can determine how it looks like.
Also, as I said before: If CqDate is declared as a string, the whole matter is not an issue
Dabas
Hi Guys,
Below is my code i can't change CqDate to string as it will give error. I have many PC use this program so the most easy way is if i can use code to do it.
Dim CqDate As Date
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "dd/MM/yyyy"
DTPicker2.Format = dtpCustom
DTPicker2.CustomFormat = "dd/MM/yyyy"
DTPicker1.Value = (CqDate - 1)
DTPicker2.Value = CqDate
Hi Dabas,
Thank you for your suggestion, DTPicker is a very nice Date tools.
in winxp the DTPicker date show 12/30/2005 but in win2k it show 30/12/2005, i want both PC also show 30/12/2005. Pls advice.
Dim CqDate As Date
CqDate = Format(Date, "dd/MM/yyyy")
DTPicker1.Format = dtpCustom
DTPicker1.CustomFormat = "dd/MM/yyyy"
DTPicker2.Format = dtpCustom
DTPicker2.CustomFormat = "dd/MM/yyyy"
DTPicker1.Value = (CqDate - 1)
DTPicker2.Value = CqDate
Business Accounts
Answer for Membership
by: leewPosted on 2005-08-05 at 22:00:28ID: 14613097
Check the Date Format in your Date/Time control Panel. It's probably set to a different region on each.