473,326 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Simple Date Problem

Hi

I have a one-line web app which works on my test server but not on the
remote server. The line of code is:

Dim myDate As Date = "31/12/2005"

This works here (New Zealand), but when I upload it to the server (USA), I
get the following error:

Cast from string "31/12/2005" to type 'Date' is not valid.

I can see why the problem's occurring - Americans write their dates
backwards. How can I fix this? There must be a setting, similar to SQL
Server's "Language=British", that will make it recognise the dates
correctly. However, I don't know where this setting is :)

Thanks in advance
Chris

Nov 19 '05 #1
2 993
Hi Chris,

Add this to your web.config and asjust it to your culture :

<configuration>
<system.web>
<globalization
culture="en-US"
uiCulture="de-DE"
/>
</system.web>
</configuration>

Let me know if you have any more questions..

Cheers,
Tom Pester
Hi

I have a one-line web app which works on my test server but not on the
remote server. The line of code is:

Dim myDate As Date = "31/12/2005"

This works here (New Zealand), but when I upload it to the server
(USA), I get the following error:

Cast from string "31/12/2005" to type 'Date' is not valid.

I can see why the problem's occurring - Americans write their dates
backwards. How can I fix this? There must be a setting, similar to SQL
Server's "Language=British", that will make it recognise the dates
correctly. However, I don't know where this setting is :)

Thanks in advance
Chris

Nov 19 '05 #2
I knew it'd be something simple :)

Thanks!
On 23/6/05 2:50 PM, in article
a1**************************@news.microsoft.com,
"To********************@pandora.be" <To********************@pandora.be>
wrote:
Hi Chris,

Add this to your web.config and asjust it to your culture :

<configuration>
<system.web>
<globalization
culture="en-US"
uiCulture="de-DE"
/>
</system.web>
</configuration>

Let me know if you have any more questions..

Cheers,
Tom Pester
Hi

I have a one-line web app which works on my test server but not on the
remote server. The line of code is:

Dim myDate As Date = "31/12/2005"

This works here (New Zealand), but when I upload it to the server
(USA), I get the following error:

Cast from string "31/12/2005" to type 'Date' is not valid.

I can see why the problem's occurring - Americans write their dates
backwards. How can I fix this? There must be a setting, similar to SQL
Server's "Language=British", that will make it recognise the dates
correctly. However, I don't know where this setting is :)

Thanks in advance
Chris



Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: gsv2com | last post by:
Maybe I'm tired, but I'm having a small problem with a date function I'm writing. Total noobish I know, but this is just going beyond me for some reason... What I want to happen is send a date...
3
by: David Thomas | last post by:
Hi, I've written a simple script to test the current date and perform an action depending on the result. The problem is, the date displays correctly as a complete date in an alert box but when I...
3
by: Don Sealer | last post by:
I'm guessing this is pretty simple however not simple enough for me. I'm developing a database to track expenses, income, banking transactions, etc. I have a very simple query with four fields,...
18
by: Q. John Chen | last post by:
I have Vidation Controls First One: Simple exluce certain special characters: say no a or b or c in the string: * Second One: I required date be entered in "MM/DD/YYYY" format: //+4 How...
11
by: samuelberthelot | last post by:
Hi, I've got 3 input HTML (dropdown lists) on my page. One for selecting a Month, one for the day, one for the year. Very simple... My problem is that I'd like to update the Days one according...
1
by: inarobis | last post by:
Hello, I am newbie in Xquery and i would like to do a simple group by date and ID. so a piece of my xml file. <Authors> <Author> <ID>1</ID> <Date>30.07.2000</Date>
3
by: Phillip Vong | last post by:
Using VS2005 w/ simple aspx in VB.net I have a simple databound textbox "LastMtgText" in a formview in the Insert template. All I want to do is make the default date of today when someone goes...
1
by: Phillip Vong | last post by:
I have a simple Formview and in the InsertMode I have a calendar and a textbox. All I want is for people to click on a date and the date is populated to the textbox. Here is my simple code and my...
11
by: Ground21 | last post by:
Hello. I'm new // sorry for my english :) I have to write simple program i c++. But I don't know how to code src - program should know it's name (unit1.exe so the name is "unit1" or "unit1.exe"...
3
toxicpaint
by: toxicpaint | last post by:
Hi everyone, I have a problem which I'm sure should be very simple to solve, but I can't work out why! Background: I'm using visual studio to create apsx, access and vb pages. I have a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.