|
-
August 8th, 2000, 10:19 AM
#1
Dates
Hi,
We've written an app that makes use of the DateValue() function. Specifically I create dates like this:
myDate = DateValue( dd & "/" & mm & "/" & yy )
where dd is the day number, mm the month number and yy the year. This worked fine on our own machines. When we tried this on a brand new machine we got an error. Looking at the documentation it says that DateValue creates the dates based on the short date format as set up on the local machine. The new machines were preconfigured with American standard dates (ie mm/dd/yy) and hence when I tried to set the date to be 31st July 2000 as 31/07/2000 I got an error.
Is there any way to get around this problem and force the system to recognise that I want to view all dates as dd/mm/yyyy ?
TIA
Welly
-
August 8th, 2000, 10:42 AM
#2
Re: Dates
if you are only displaying dates in this format, why not use the Format function:
txtDate.Text = Format(date,"dd/mm/yyyy")
the date can be in any format in the database, or source file, but when you want to display it - just format like so.
if you need to create a date - create a date as you normally would, then when it comes time to show it, use the format function.
hope this helps,
John
John Pirkey
MCSD
http://www.ShallowWaterSystems.com
http://www.stlvbug.org
John Pirkey
MCSD (VB6)
http://www.stlvbug.org
-
August 8th, 2000, 10:55 AM
#3
Re: Dates
Thanks but it doesn't help! I am actually creating dates from the raw components of day,month & year. What I think I need to know is what is the system short date format - that way I can then create dates safely.
-
August 8th, 2000, 10:57 AM
#4
Re: Dates
the GetDateFormat API might be helpful.
-
August 8th, 2000, 11:06 AM
#5
Re: Dates
Thanks - I'll have a look into that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|